Posted By

manavecplan on 09/12/10


Tagged


Versions (?)

personalised read more


 / Published in: PHP
 

  1. add_filter('the_content_more_link', 'jorbin_the_content_more_link_filter', 10, 2);
  2.  
  3. function jorbin_the_content_more_link_filter($original, $more_link_text){
  4. global $post;
  5.  
  6. if( is_user_logged_in() ) {
  7. global $current_user;
  8. get_currentuserinfo();
  9. $more_link_text = "Hey {$current_user->display_name}, why don't you read more";
  10. }
  11.  
  12. return '<a href="' . get_permalink() . "#more-{$post->ID}\" class='more-link'>$more_link_text</a>";
  13.  
  14. }

Report this snippet  

You need to login to post a comment.