Support » How-To and Troubleshooting » [Resolved] Displaying all posts on Twenty Eleven homepage

[Resolved] Displaying all posts on Twenty Eleven homepage

  • I’m trying to get all my posts to be displayed on the homepage of my blog – or in the future at least the latest five.


    As you can see, at the moment only the latest post shows up (they also only show up if you put them as uncategorized, but that’s another issue)

    (I’m using a twenty eleven child theme)

    I’ve checked settings/reading and that says it should show the latest 10, so I figure it’s something to do with the index.php or content.php

    I’ve already tried looking through the forums and using some of the suggestions, but nothing seems to have worked.

    Thanks for the help.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Michael


    Forum Moderator

    have you edited index.php in any way to exclude some of the categories?

    All I’ve done is to overwrite a child file i downloaded with design tweaks…

    Index.php should be as below:

    [code moderated – use the pastebin for any code over the forum limit of 10 lines]



    Forum Moderator

    have you tried to switch themes to Twenty Ten to eliminate theme issues?

    what happens if you deactivate all plugins?

    Works fine in both twenty ten and twenty eleven parent themes and nothing changes when the plugins are deactivated – so, must be something to do with the child template I downloaded.

    Unfortunately the template has been installed by our webmaster who is hosting it off-site.

    Is there any code I can put into the child theme that you know of that will allow me to overwrite this?

    How about editing this index.php – think this should be the correct file.


    Fixed it. Thanks for the help… talking it through made me realise the issue.



    Forum Moderator

    EDIT: just saw the ‘fixed it’ note – can you describe how?

    it might help someone in the future..

    ignore my fixed it… did it very simplistically by editing the lines:

    // Set up the secondary loop query
    $args = array(
    ‘numberposts’ => 1, // number of posts to return
    ‘cat’ => $my_cat // the category id

    to read:
    // Set up the secondary loop query
    $args = array(
    ‘numberposts’ => 5, // number of posts to return
    ‘cat’ => $my_cat // the category id

    So that each category would show five. Your way was much better for the long run.

    Ok – so I’ve not got it displaying posts as I want.

    To help anyone else who stumbles across this, the way I solved it was by simply removing the code from the child’s index.php and pasting in the original twenty eleven parent index.php

    This way I don’t have any of the category restrictions that the template I download had implemented.

    Sounds simple enough, but didn’t occur to me until I talked it through…




    Forum Moderator

    Is there anyway of ensuring that the way they are pulled is done by the date?

    new approach using your pasted index.php;
    largely re-written

    you need to amend the list of category IDs to match the categories of your site

    http://pastebin.com/dtn8T43f (deleted from pastebin)

    http://pastebin.com/YdE0VvwT (minor edits for the ‘404’ scenario)

    to show one post per category from the array list (no duplicates), sorted by date



    I have the exact same problem…

    Only posts that is “Uncategorized” will show up on the first page. I tried to replace the index.php in my child-theme folder with the index.php from parent but it did not work.

    Any ideas?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] Displaying all posts on Twenty Eleven homepage’ is closed to new replies.