Hi Vanessa,
Apologies I have been away on holiday for a while but am back now.
It’s quite hard to walk through step by step because I don’t know your exact requirements.
All you need to do is include it on a specific page is created some if rules in the header.php file, something like below:
<?php if( your_specific_rules() ) echo do_shortcode('[responsive_menu_pro]'); ?>
All the best
Hi, thank you for getting back to me, can you clarify what you mean by your specific rules? I’m sorry I’m really new to this. For example I have a page called “about” how would I include this in the above short Code?
Oh and would I include this in the WordPress header file for the entire site, or the header for the specific page? I am using optimize press on these pages, and they allow me to place short code, so would I place it there, or in the WordPress header file?
Thank you!!
Hi Vanessa,
This is where I can’t really help more as I have no idea about your setup. You will need to speak to your web developer as they will know how your site works and fits together etc.
For example if you have a specific Page ID for the about page you could use that in your if rules or if it uses a specific page template you can use that.
All the best
I am my web developer. I don’t have the funds to hire someone to look at this. Could you give me an example of what using the above short code would look like if I was using a. Page I’d?
I’m willing to try a few things to see what works. I really need to get this ironed out. Thank you.
Hi Vanessa,
Something like below should work:
<?php
if( get_queried_object_id() == 75 ) :
echo do_shortcode(‘[responsive_menu_pro]’);
endif;
?>
You may need to play around with some stuff though or find other ways of getting the Page ID if the above doesn’t work.
All the best
Do I place this on each page that I want the menu to appear on?
well…almost. I got it to appear on the pages I wanted it to, but now it is also appearing on the pages I don’t want it to. Can you tell me how to take it off the pages I don’t want it appearing on?
I added the php code using a plugin, on the pages that I wanted it to be shown on, but it is now also being shown on the pages I don’t, so i have two menus on those pages (yours and my theme’s menu).
is there a php code I can use to tell it not to show up on certain pages?
nevermind, figured it out. π
Hi Vanessa,
I would suggest your if statement is not right then, it is probably just returning true for every eventuality – you will need to debug it either via some var_dumps() or echo statements to see what it is returning on different pages, also debug the get_queried_object_id() function to see if it is returning the expected value on each page.
I feel like you may need to invest some time in learning at least some basic PHP knowledge otherwise you are going to keep running into issues like this and a lot of things will be site specific (as in this example) so people won’t always be able to help you.
I and the WP community can guide you as I have done down the right path but can’t give any exact answers or full code snippets as it is not my site and I don’t know the setup etc.
Also I wouldn’t be using plugins to inject PHP code unless you have not setup child themes and are worried about making your theme upgrade proof?
All the best