WordPress.org

Forums

[resolved] Displaying all posts on Twenty Eleven homepage (12 posts)

  1. jack.allen@bellisjoneshill.com
    Member
    Posted 3 years ago #

    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.

    http://www.bellisjoneshill.co.uk/blog/

    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.

  2. alchymyth
    Forum Moderator
    Posted 3 years ago #

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

  3. jack.allen@bellisjoneshill.com
    Member
    Posted 3 years ago #

    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]

  4. alchymyth
    Forum Moderator
    Posted 3 years ago #

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

    what happens if you deactivate all plugins?

  5. jack.allen@bellisjoneshill.com
    Member
    Posted 3 years ago #

    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?

  6. jack.allen@bellisjoneshill.com
    Member
    Posted 3 years ago #

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

    http://pastebin.com/XFchAWPy

  7. jack.allen@bellisjoneshill.com
    Member
    Posted 3 years ago #

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

  8. alchymyth
    Forum Moderator
    Posted 3 years ago #

    EDIT: just saw the 'fixed it' note - can you describe how?

    it might help someone in the future..

  9. jack.allen@bellisjoneshill.com
    Member
    Posted 3 years ago #

    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.

  10. jack.allen@bellisjoneshill.com
    Member
    Posted 3 years ago #

    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...

    Thanks.

  11. alchymyth
    Forum Moderator
    Posted 3 years ago #

    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

  12. andershaslum
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic