ThemeShaper Forums » Thematic

[closed]

Teaser "read-more-link" does not show

(2 posts)
  • Started 9 years ago by Lasson
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. Lasson
    Member

    Hi

    Trying different ways to show content excerpts to find my optimal solution. When I use the teaser, by using <!--more--> in the post it cuts off in the right place but it wont show any read more link. I have a child theme to thematic and I have added this code to add a read more link to the auto-generated excerpt. But this function should not change anything for the teaser I guess

    function excerpt_ellipse($text) {
    return str_replace('[...]', '<img src="/wordpress/wp-content/themes/dhf/images/icons/arrow.png" class="wp-more" /> <a href="'.get_permalink().'">read more</a>', $text); }
    add_filter('get_the_excerpt', 'excerpt_ellipse');

    What function checks for the <!--more--> tag? So I can look how it looks like and try to find a solution. Does this work ok in regular thematic?

    Posted 9 years ago #
  2. Excerpts are giving me hell too. Custom excerpts don't generate those ellipses that you can then str-replace w/ a link.. and it could be the same w/ the more tag.

    I just had to add them in there myself (using them on archive and search pages here) by filtering them into the post content with:

    function mytheme_excerpt($post) {
     if( (is_archive()|| is_search()) {
       $post = '';
       $post .= '<p>' . get_the_excerpt() . '</p>' ;
       $post .= '<p><a rel="nofollow" class="read_more" href=' . get_permalink() . '>Keep Reading &raquo;</a></p>';
    	}
    	return $post;
    }
    add_filter('thematic_post', 'mytheme_excerpt');

    and then disappear away the ... ellipses. Of course now they show EVERY time ... even if a post is super short, but that is also pretty uncommon.

    I don't know if it will help, but I just saw that the more tag doesn't work/show on paged pages unless you declare:

    <?php global $more;?>

    in the page template.

    hope that could help you a little...

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.