Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm fairly new to WP but absolutely loving it.

And here is my problem. I know that this topic it's 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

dompl

share|improve this question
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
add comment

migrated from stackoverflow.com Feb 4 '11 at 21:35

This question came from our site for professional and enthusiast programmers.

2 Answers

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; ?>
share|improve this answer
add comment

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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