WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to make read more function work? (3 posts)

  1. Mohamad Hanafi
    Member
    Posted 1 year ago #

    I used WP 3.4.1 with Box-Of-Boom Theme.

    I have problem to show excerpt in every single feed article in my blog.
    These are settings which is currently done/set.

    1. Reading Settings

    For each article in a feed, show Summary

    2. In function.php

    function boxofboom_excerpt_length( $length ) {
    	return 100;
    }
    add_filter( 'excerpt_length', 'boxofboom_excerpt_length' );
    
    /**
     * Returns a "Continue Reading" link for excerpts
     */
    function boxofboom_continue_reading_link() {
    	return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'boxofboom' ) . '</a>';
    }

    Is there any missed php code to be called in page.php?

    Refer my web

    Thanks.

    Hanafi.

  2. vtxyzzy
    Member
    Posted 1 year ago #

    I think your boxofboom_continue_reading_link() function needs to be added to the excerpt_more filter:

    function boxofboom_continue_reading_link($more) {
    	return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'boxofboom' ) . '</a>';
    }
    add_filter('excerpt_more', 'boxofboom_continue_reading_link');
  3. Mohamad Hanafi
    Member
    Posted 1 year ago #

    Hi, vtxyzzy

    Very brilliant idea.

    Thanks!

    Hanafi.

Topic Closed

This topic has been closed to new replies.

About this Topic