0

I know that this topic is already on the Forum but the solution simply don't work for me.

I have a few pages where I would like to split content using read more.

So I have done recommended hack by adding global

$more; and $more = 0; the_content();

and everything seem to look ok although every time I click on read more link nothing happens and following result appear in my browser:

http://www.mysite/#more-15

Could anyone help me?

Many Thanks in advance

  • 1
    Please link to the forum post and where-ever you're getting this code; the more context you can give us, the better. Also, please explain what you're wanting to do more specifically -- are you wanting page excerpts on your front page? The excerpt you have above probably goes inside of The Loop, in the case. – aendrew Feb 4 '11 at 21:41
2

Better to use <!--nextpage--> if you want to split content. See theme requirement: http://codex.wordpress.org/Template_Tags/wp_link_pages

I don't understand why people keep wanting "Read more" to work in Pages.

  • Well, probobly for the same reason the feature was develop for. many thanks for the next page tip, but Im more trying to get read more running on page. – Dom Feb 5 '11 at 20:46
  • Let me ask you this. How does <!-- more --> work in Posts? Unless you're a listing archive list of Pages it should work out of the box. E.g example.com/?post_type=page – zeo Feb 6 '11 at 7:16
0

The only reason to use a $more variable is if you feel the need to edit the 'read more' text that displays automatically. If you just want to chunk it up and don't care what it says...

<?php the_excerpt ?>

in place of wherever the content is called. So, for instance a standard loop on a page that displayed all posts as excerpts would look like this...

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
// You can shove other things like voting and meta data or whatever in here...
<?php the_excerpt ?>
// You can shove other things like voting and meta data or whatever in here...
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.