WordPress.org

Ready to get started?Download WordPress

Forums

Posts showing 3 Times (9 posts)

  1. jphogan
    Member
    Posted 2 years ago #

    Here is the home page of my blog http://www.iamsinc.com/blog

    For some reason, my most recent post is showing up 3 times in a row. I have tried deactivating all my plugins and that didn't fix it. I even tried making a different post "sticky" to force it on the home page and that made no difference.

    I am using the twenty eleven theme. Does anybody have any idea what's going on? Any help is very appreciated. Thank you!

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    have you edited index.php or content.php in any way?

    or added any functions to functions.php?

    what if you switch themes to Twenty Ten?
    or switch the parent theme Twenty Eleven?

  3. jphogan
    Member
    Posted 2 years ago #

    I have not edited the index.php or content.php in any way or added any functions.

    If I switch to Twenty Eleven it does correct the problem. Does that mean something in my child theme is messing it up. Should I reinstall the child theme? Do you need me to copy and paste code from the child theme here?

    Thank you for your help!

  4. jphogan
    Member
    Posted 2 years ago #

    Also, I should add that it was working fine until I added a post today. I just set that post to private and reloaded the page to test and now it's working properly. Sorry for the basic questions, but does that mean the problem lies somewhere in the html of my recent post?

  5. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    Do you need me to copy and paste code from the child theme here?

    this might help, if index.php (or home.php if exists) and content.php (and possibly functions.php) are in the child theme folder - which could mean that these templates are different from the original Twenty Eleven.

    just in case - http://codex.wordpress.org/Forum_Welcome#Posting_Code

  6. jphogan
    Member
    Posted 2 years ago #

    Thank you. Here they are:
    Index.php

    [158 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

  7. jphogan
    Member
    Posted 2 years ago #

    Let me try that again.
    Index.php http://pastebin.com/XLSyyJU0

    Pageofposts.php http://pastebin.com/KJ3qpzEY

    functions.php http://pastebin.com/f0c5zZ7d

    These are the only php files I have with my child theme.

    Thanks again for your help.

  8. jphogan
    Member
    Posted 2 years ago #

    I went ahead and deleted the three php files. It has "fixed" my issue so that the post is no longer showing up multiple times. I don't know very much about php, but I'm wondering if this code from the index.php file is what caused it.

    /*
    * Rather than modify the main Loop, we'll use get_posts to create 3 secondary loops that grab * the first post from each of these categories. This has the benefit of leaving the main Loop * untouched if you want to call it later on in the page.
    */
    foreach ( $my_cat_array as $my_cat) :

    When it "grabs the 1st post from each of the three categories" could it have been pulling the same post three times?

  9. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    yes - you are right.

    the deleted index.php assumed that you filled in this line 13 with relevant category ids:

    $my_cat_array = array(5,3,22,1);

Topic Closed

This topic has been closed to new replies.

About this Topic