• Resolved wildapache

    (@wildapache)


    What I trying to do:

    1. wp-admin -> create page : My test [my-test]
    2. create template page : page-my-test.php
    3. inside page-my-test.php i have a wp_query to get post by args
    4. inside page-my-test.php before get_footer() I have a required inc-footer.php

    The problem is

    1. I put in my inc-footer.php this : <?php echo is_page(); ?>
    2. After I go to My Test template page where I can see all post by args (via wp_query & foreach).
    3. The problem is: IS_PAGE() doesn’t work in inc-footer.php

    But ! Attention ! If i remove wp_query from page-my-test.php

    inc-footer.php – show 1 ! So it’s works !

    How I can resolve this confilct or what ?

    Note: I few words, I need to know what I stay exactly on my test page now… but is page with wp_query in inc-footer.php doesn’t work.

    • This topic was modified 3 days, 9 hours ago by wildapache.
    • This topic was modified 3 days, 9 hours ago by wildapache.
Viewing 1 replies (of 1 total)
  • Thread Starter wildapache

    (@wildapache)

    Thank you so much ! Now I know a little more.

    I just put my wp_reset_query() before required inc-footer.php and now it works as well !

    • This reply was modified 3 days, 8 hours ago by wildapache.
    • This reply was modified 3 days, 8 hours ago by wildapache.
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.