• By default, it looks like the “read more” text in entries displays only on single post / permalink pages.

    I’d like to display the “more” text on the index page. (Why? So that I can hide it via javascript and have a link which then shows it.) Does anyone know how to make a specific page display the “more” text?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Actually, out of the box WP does not display the “read more” link on single post view, only on the multipost view pages like index, archives, search results.

    Thread Starter nate451

    (@nate451)

    Sorry, I’ll try to clarify; I apologize for saying the wrong thing.

    I’d like to display the actual content that comes after the ‘read more’ link. WP seems fully capable of letting me do anything I want to the actual read more link. What I’d like to find out is how to make any given instance of the_content display all of the text and not just what comes before “read more”.

    Does that make more sense?

    Thread Starter nate451

    (@nate451)

    In Movable Type, I would do this by using the <mt:EntryMore /> tag. That doesn’t seem to be possible in WP, and I’m just trying to find a way to get this text on my index page.

    I have never used MT, so I have no idea how that works. Maybe WP doesn’t work in the way you expect it. It happens quite often when we switch from a script to another.

    In WP if you insert the “more” link while writing the post – it will cut the text on any multipost view.

    Thread Starter nate451

    (@nate451)

    Right. I’m attempting to modify that behavior.

    For the record, I made some headway, but it’s editing post-template.php. I should probably figure out how to do this via a plugin.

    I modified lines 118-125 as follows:

    if ( count($content) > 1 ) {
    		if ( $more ) {
    			$output .= '<span id="more-'.$id.'"></span>'.$content[1];
    		} else {
    			$output = balanceTags($output);
    			if ( ! empty($more_link_text) )
    				$output .= '<p><a href="#" class="show">Read More &raquo;</a></p><div class="more"><span id="more-'.$id.'"></span>'.$content[1].'</div><!-- end .entrymore -->';
    		}

    Basically, the text in the “else” condition on line 121 seems to be what displays on a non-permalink page. I’d love anyone else’s thoughts on more elegant ways to do this.

    Thread Starter nate451

    (@nate451)

    To be a bit clearer, the essential thing was adding .$content[1] to line 124. I don’t know #$%@ about PHP, but it looks like the code sets the text before the <!--more--> link as the first item in the array ($content[0]) and the text after the <!--more--> link as the second item ($content[1]).

    I’d love a way to tell WP to append this data only on certain pages.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to change which pages display “read more” text’ is closed to new replies.