WordPress.org

Ready to get started?Download WordPress

Forums

[Theme: GamePress] Read More doesn't show up adding excerpt to post (2 posts)

  1. ConCity
    Member
    Posted 1 year ago #

    When I add an excerpt to my post the normal "read more" permalink dissapears - giving the appearance that there's nothing more to read.

    Site http://www.theconfoundit.com
    version 3.4.2

    Thanks!

  2. ConCity
    Member
    Posted 1 year ago #

    Dug into the functions and fixed it myself. Posting here incase anyone else wants to do the same.

    I commented out the returns on excerptmore line 191 and the morelink on line 196.
    Then added echo and the call to the permalinlink on line 212. Finished code is below.

    I also change the verbage from Read more. Read the remainder.

    function gamepress_excerptlength_teaser($length) {
        return 20;
    }
    function gamepress_excerptlength_default($length) {
        return 40;
    }
    function gamepress_excerptmore($more)
    {
    	global $post;
    	//return '... <br /><a  class="more" href="' . get_permalink($post->ID) . '">'.__('Read the remainder of this article', 'gamepress').' &raquo;</a>';
    }
    function gamepress_morelink($more)
    {
    	global $post;
    	//return '... <a class="more_link" href="' . get_permalink($post->ID) . '">'.__('Read the remainder of this article', 'gamepress').' &raquo;</a>';
    }
    
    function gamepress_excerpt($length_callback='', $more_callback='') {
        global $post;
        if(function_exists($length_callback)){
            add_filter('excerpt_length', $length_callback);
        }
        if(function_exists($more_callback)){
            add_filter('excerpt_more', $more_callback);
        }
        $output = get_the_excerpt();
        $output = apply_filters('wptexturize', $output);
        $output = apply_filters('convert_chars', $output);
        $output = '<p>'.$output.'</p>';
        echo $output;
    	echo '...&nbsp; <a  class="more" href="' . get_permalink($post->ID) . '">'.__('Read the remainder of this article', 'gamepress').' &raquo;</a>';
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.