WordPress.org

Support

Support » How-To and Troubleshooting » Twenty Eleven child theme shows only one recent post

Twenty Eleven child theme shows only one recent post

  • Hi,

    I setup my webpage to nest the recent posts under the page “Articles”. From some reasons it shows only one post, while I want it to show 10 posts opened at the same page. The Reading Settings seems correct (show at most 10 blogs). How can I fix it?
    web address:
    cosmogrill.me/posts/

    Best.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Michael

    @alchymyth

    Forum Moderator

    the ‘showcase’ template does exactly that – it shows one full recent post and the others in a list;

    you seem to have only two recent posts (?)

    Thanks the reply!

    Yes, I have only two posts (so far).

    I’ve changed it to Showcase template, and it remained the same. I would want them all to be “open”, instead of folded in a list, similarly to this page: http://www.whatdoyoulivefor.net

    Moderator Michael

    @alchymyth

    Forum Moderator

    copy showcase.php from Twenty Eleven into Hum;

    change:

    // The first Recent post is displayed normally
    					if ( $recent->have_posts() ) : $recent->the_post();
    
    						// Set $more to 0 in order to only get the first part of the post.
    						global $more;
    						$more = 0;
    
    						get_template_part( 'content', get_post_format() );
    
    						echo '<ol class="other-recent-posts">';
    
    					endif;
    
    					// For all other recent posts, just display the title and comment status.
    					while ( $recent->have_posts() ) : $recent->the_post(); ?>
    
    						<li class="entry-title">
    							<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
    							<span class="comments-link">
    								<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?>
    							</span>
    						</li>
    
    					<?php
    					endwhile;
    
    					// If we had some posts, close the <ol>
    					if ( $recent->post_count > 0 )
    						echo '</ol>';
    					?>

    to:

    // The Recent posts all displayed normally
    					if ( $recent->have_posts() ) : while ( $recent->have_posts() ) : $recent->the_post();
    						// Set $more to 0 in order to only get the first part of the post.
    			global $more;
    			$more = 0;
    
    			get_template_part( 'content', get_post_format() );	?>
    			<?php endwhile; endif; wp_reset_postdata(); ?>

    Thank you Alchymyth for answering the question, I did exactly like your instruction (I have WordPress twenty eleven showcase), it worked, but the recent posts are difficult to see, recognize; I mean there’re not spaces and lines between recent posts. So can you please fix again the code above? and at the end of page will be the link Older posts (mysite.com/paged=2)

    I’m waiting for your answers
    Thank you so much.
    Regards.
    Ha My

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Twenty Eleven child theme shows only one recent post’ is closed to new replies.