• Resolved savannahdaras

    (@savannahdaras)


    Hi there,
    I was wondering if there is a way to limit the number of posts visible on the home page?
    My site: http://wanderlustingwonders.com/

    I just don’t want the posts going past the side bar content, as it looks weird and empty once the side bar content disappears and you scroll past it.

    Also, is there a way to have the home page look as it does now with the right side bar and the posts, but then when a specific post is selected, it displays the entire post in full format without the side bar? (hopefully that makes sense).

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    in order to change the number of posts visible on the homepage you can put your theme index.php file in your child folder (assuming you are working with a child theme). Then find <?php if ( have_posts() ) : ?>. It is around line 18. Right before this line put this <?php query_posts('showposts=3'); ?>. This will display 3 posts. You can adjust this number to whatever you like.

    Regarding your second question, are you trying to remove the sidebar from all posts but the homepage? If so, move your sidebar.php file to your child theme. Then put this code as the first line <?php if ( is_front_page() ) { ?> and this code <?php } ?> at the end of the page, after the last line. This will remove the sidebar from all posts but the homepage.

    Now you only have to adjust the width of the post pages by adding this code to your child style.css:

    #primary {
        width: 100%;
    }
    .home #primary {
        width:600px;
    }

    I hope this helps.

    Theme Author alex27

    (@alex27)

    You can limit number of posts displayed on home page & category/archives pages from Settings > Reading in your dashboard, no child theme needed for that.

    Thread Starter savannahdaras

    (@savannahdaras)

    Perfect – thank you all for your help! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Limit number of posts visible on first page’ is closed to new replies.