Detect current page
-
What I trying to do:
- wp-admin -> create page : My test [my-test]
- create template page : page-my-test.php
- inside page-my-test.php i have a wp_query to get post by args
- inside page-my-test.php before get_footer() I have a required inc-footer.php
The problem is
- I put in my inc-footer.php this : <?php echo is_page(); ?>
- After I go to My Test template page where I can see all post by args (via wp_query & foreach).
- 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.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.