WordPress.org

Ready to get started?Download WordPress

Forums

Multipe excerpts, length & read more (2 posts)

  1. baszer
    Member
    Posted 2 years ago #

    Hi,

    i found the following script for multiple excerpts. But I also want to change the read more.

    For example, I want a page with excerpts of 55 characters with read more and I want a page with 25 characters and only show ...

    How can I fix that?

  2. inhouse
    Member
    Posted 1 year ago #

    Did you ever figure this out? I use this function that removes the more tag essentially and then I call a more tag manually for each area of the site I want different more tags.

    function new_excerpt_more($more)
    {
        global $post;
    	return '<a class="moretag" href="'. get_permalink($post->ID) . '"> </a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');

    My excerpt call looks like this. You can easily customize what the more tag looks like both with HTML and then CSS of course.

    echo apply_filters('the_excerpt',get_the_excerpt().'<a href="'.get_permalink().'"> more ยป</a>');

Topic Closed

This topic has been closed to new replies.

About this Topic