Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WP posts displaying content of first post of category

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #27071
    jmizi
    Member

    Hey, Im really confused.
    So I have multiple single.php templates and there are synced up to different category archive pages via the main single.php.
    Thats all good and dandy. Im using this technique: http://elliotjaystocks.com/blog/tutorial-multiple-singlephp-templates-in-wordpress/
    I ran into a problem, all the post the_title and the_content tags are grabbing the info from my fist post in its category.
    ie I have 3 posts under the portfolio category, the first one looks right, but the last 2 posts are grabbing the title and content info from the first post… Everything else like the wp_title and the custom fields i have are all pulling from the appropriate post.

    So whats the deal?? I’m cant figure this one out. Here is the single-blog.php file.

    Code:

    Blog&Stuff

    #67474
    AshtonSanders
    Participant

    whoa there. So first you do this for your sidebar:

    Code:

    That line of code overwrites the "default" query for that page…. so it will always show cat 4 max posts = 10

    You need to reset the "Loop" back to what it should be for that page. I believe this is the code for that:

    Code:

    Let me know if that does the trick

    (another way to handle it is to have the sidebar list display after the main content (in the html), and use CSS to make sure it’s placed in the right spot.)

    #67481
    jmizi
    Member

    HOO-RAH! You are brilliant! I used the latter suggestion and it worked liked a charm. Thanks so much!

    #67482
    AshtonSanders
    Participant

    Excellent.

    Did you try the <?php wp_reset_query(); ?> ?

    I forget if that’s the right query…

    Thanks,

    #67485
    jmizi
    Member

    I just tried it, both ways worked perfectly. i think this is the 2nd post of mine you answered in this forum. Thanks again!! :D

    #67486
    AshtonSanders
    Participant

    Excellent. You’re welcome.
    Thanks for answering my post ;)

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.