WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Static homepage still showing posts ? why ? (14 posts)

  1. Akasashasha
    Member
    Posted 1 year ago #

    Hello,

    using twenty eleven.
    I chooses a static page for homepage, but it still continue to display posts under my static page ... I want only the static page to appear on homepage no posts at all ... how to do this please ?

    thank you

    edit : and also how to get rid of the "recent post" on bottom of home page ?

  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

    please post a link to your site to illustrate what is showing on your front page;

    are you using the 'showcase template' for the static front page?

    do you have any 'sticky' posts in your site?

    are you working with a child theme?

  3. Akasashasha
    Member
    Posted 1 year ago #

    Hello,

    I can't post a link cause I'm still working locally.
    I'm using twenty eleven.
    not show case
    no sticky post
    no child theme

    each time I create a post, it appears on home page below my static page ... I thought choosing static home page would be enough to undo this but it is not ...

  4. alchymyth
    Forum Moderator
    Posted 1 year ago #

    creating a child theme is strongly recommended if you want to customize the default theme; http://codex.wordpress.org/Child_Themes

    are you using any footer widgets?

    can you post a screenshot of your front page?

  5. Akasashasha
    Member
    Posted 1 year ago #

    heu ... how to insert a screenshot ?

  6. alchymyth
    Forum Moderator
    Posted 1 year ago #

    heu ... how to insert a screenshot ?

    you need to upload your image to an image hosting site (such as http://imageshack.us/ - no recommendation, do your own search to find one) and then post the link to the uploaded image here.

  7. Akasashasha
    Member
    Posted 1 year ago #

    here it is :

    https://picasaweb.google.com/lh/photo/5todxITR1hExVGFUuOdIP9MTjNZETYmyPJy0liipFm0?feat=directlink

    as you can see there is a "citation" on right side which is my static page, and below there is this "home" post that has nothing to do here ...

  8. alchymyth
    Forum Moderator
    Posted 1 year ago #

    this looks like the front page is using 'showcase template' -

    check when you edit the page - on the right under 'page attributes';

    if so, then there are some solutions...

  9. Akasashasha
    Member
    Posted 1 year ago #

    right ! it was on the "showcase template" option ... I changed it but know it do not looks as I want, I really enjoy this "citation" way of appearing ...
    how to display it the same way but without the posts appearing on the same pages ?

  10. alchymyth
    Forum Moderator
    Posted 1 year ago #

    possibility one:

    a css 'quick fix':
    add this to style.css of the child theme:

    .page-template-showcase-php .recent-posts { display:none; }

    or, if you actually only want to remove those recent posts from the static front page, try:

    .home.page-template-showcase-php .recent-posts { display:none; }

    possibility two:

    more complex, but imho a cleaner solution;
    edit the template showcase.php, and remove this section:

    <section class="recent-posts">
    					<h1 class="showcase-heading"><?php _e( 'Recent Posts', 'twentyeleven' ); ?></h1>
    
    					<?php
    
    					// Display our recent posts, showing full content for the very latest, ignoring Aside posts.
    					$recent_args = array(
    						'order' => 'DESC',
    						'post__not_in' => get_option( 'sticky_posts' ),
    						'tax_query' => array(
    							array(
    								'taxonomy' => 'post_format',
    								'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ),
    								'field' => 'slug',
    								'operator' => 'NOT IN',
    							),
    						),
    						'no_found_rows' => true,
    					);
    
    					// Our new query for the Recent Posts section.
    					$recent = new WP_Query( $recent_args );
    
    					// 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>';
    					?>
    				</section><!-- .recent-posts -->
  11. Akasashasha
    Member
    Posted 1 year ago #

    thanks a lot ... knowing that there will be a blog page on this website where all the post will appear in chronological order : does this changes will affect the blog pages or only the home page ? in this case which of the proposed option would be the best for me ?

  12. alchymyth
    Forum Moderator
    Posted 1 year ago #

    this change will only effect pages which are using the 'showcase template'.

    the blog page = posts page is done by index.php ...

  13. Akasashasha
    Member
    Posted 1 year ago #

    ok, I'll give it a try after lunch (I'm in France and it's 12h00 here), make different kinds of test and tell you if it worked properly ...
    meanwhile, thanks again for your help, I really appreciate that

  14. Akasashasha
    Member
    Posted 1 year ago #

    hello achymyth,

    I followed the latest suggestion of removing some code in the showcase.php and everything is working perfectly.
    Thanks a lot ... if you stop in south of France one day, email me and I'll offer you a fresh bier (or bottle of red wine, as you want)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.