general:
edit loop.php, locate the second occurrence of:
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
change it to:
<?php if ( is_archive() || is_search() || is_paged() || $wp_query->current_post >= 2 ) : // Only display excerpts for archives and search. ?>
if you need to exclude other sections, you could use:
<?php if( $wp_query->current_post < 2 && !is_paged() ) : ?>
STUFF TO SHOW ONLY FOR FIRST TWO POSTS ON FRONT
<?php endif; ?>
to adjust the length of the excerpts, change the number here in functions.php:
function twentyten_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'twentyten_excerpt_length' );
Okay, I have replaced
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
in the loop with
<?php if ( is_archive() || is_search() || is_paged() || $wp_query->current_post >= 2 ) : // Only display excerpts for archives and search. ?>
but nothing seems to have happened – I am doing this on a test site, not the actual blog.
What code do I need to add to the homepage/page2 for it to work?
We currently use the page home.php for the home, not index.php, as we had to create this page to allow use to show only 3 posts on homepage, and then more on pages after that.
Thanks for your help.
We currently use the page home.php for the home
what is the code of that template?
http://codex.wordpress.org/Forum_Welcome#Posting_Code
does your theme have a loop-home.php template?
if not, then loop.php will do the job, and my suggestion should in principle have worked;
this line appears twice in loop.php:
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
did you edit the one which appears closest to the end of the template?
Loop home
http://pastebin.com/p7jbWrxa
this line appears twice in loop.php:
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
did you edit the one which appears closest to the end of the template?
– yeah :-/
with your structure having a home.php, did you make the suggested edits in loop-home.php (in line 132) ?
Working thanks 🙂
A few things I would like to modify if possible
1) it shows the excerpt, can we get it to show the first say 500 characters of the post instead?
2) how can I remove the tags and categories below these posts? (page2,3,4 etc. only, not category, tag and author archives)
1) there might be plugins; or this has posssibly been answered before in the forum – forum search?
2)
I already suggested the initial approach with a conditional statement around these codes –
to remove those postmetadata on all those excerpts of the front page and its follow pages:
before this line:
<div class="entry-utility">
add:
<?php if( !is_home() || is_home() && $wp_query->current_post < 2 && !is_paged() ) : ?>
then, after this line:
</div><!-- .entry-utility -->
add:
<?php endif; ?>