• Resolved jesusjf

    (@jesusjf)


    Buttons are not showing when I use the get_content() since I have a custom script to apply ‘Read more’ links to individual posts.

    Only when the function defaults to the_excerpt(), do the buttons show up.

    Is there a way to make it show the buttons in this case?

    My function:

    function show_content_before_more_tag($post){
      global $more;
      $more = 0;
    
      // checks to see if the is a 'more' tag in post
      // show if theres is
      // truncate post if there is not
      $ismore = @strpos($post -> post_content, '<!--more');
      if($ismore){
        $content_arr = get_extended( get_the_content() );
        echo $content_arr['main'];
      } else {
        the_excerpt();
      }
    }
    
    // Replaces the excerpt "more" text by a link
    function new_excerpt_more($more) {
      global $post;
      return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read more.</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: ShareThis] Buttons not appearing’ is closed to new replies.