• jphogan

    (@jphogan)


    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!

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

    (@alchymyth)

    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?

    Thread Starter jphogan

    (@jphogan)

    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!

    Thread Starter jphogan

    (@jphogan)

    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?

    Michael

    (@alchymyth)

    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

    Thread Starter jphogan

    (@jphogan)

    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]

    Thread Starter jphogan

    (@jphogan)

    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.

    Thread Starter jphogan

    (@jphogan)

    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?

    Michael

    (@alchymyth)

    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);
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Posts showing 3 Times’ is closed to new replies.