• Resolved Cathy Mitchell

    (@multitalentedmommy)


    I have this https://pastebin.com/m1450fff6 in my header. and it
    is effecting which posts are queried in all templates.
    I cannot move it out of the header position, and would like it to display on all pages.

    Is there a way to go back to the regular post queries after this code is ‘finished’?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Change it to a new WP_Query instead, so that you don’t affect the default one.

    See https://pastebin.com/md59e786

    Thread Starter Cathy Mitchell

    (@multitalentedmommy)

    I’m getting a syntax error. I’ve checked the syntax the best I know how. But it doesn’t like the last line of the code – <php endif;?>.

    I wish I could understand more of what this code is doing. I got the wordpress tags, but as soon as it goes into php & wp queries, I get lost! So I can’t even tell if the code isn’t running a normal loop? It doesn’t want to end the loop? No idea.

    Thanks for any help. ??

    Thread Starter Cathy Mitchell

    (@multitalentedmommy)

    problem solved. Removed the endif. I suppose its not a loop or er something. lol

    thanks for the awesome code, Otto!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Actually, I left out a colon. ??

    Here’s the fixed code:
    https://pastebin.com/md59e786

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Query Posts wrecking the template hierarchy?’ is closed to new replies.