WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Eleven child theme shows only one recent post (5 posts)

  1. wpcosmogrill
    Member
    Posted 1 year ago #

    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.

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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 (?)

  3. wpcosmogrill
    Member
    Posted 1 year ago #

    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

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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(); ?>
  5. phamhamy
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic