Hi
I can’t access your post: http://screencast.com/t/Nztk4S4UDijk
You can remove the menu from a single post by editing the file corresponding with the header style used and adding this condition like here: http://screencast.com/t/Uw5VtIAtlq
<?php
if ( ! is_single('post-id')) { ?>
menu container
<?php } ?>
Replace the post-id with the post’s id for which you want to remove the menu. To get the post id follow this link: http://screencast.com/t/H6PLh7nUec
Note that if you use this method and you have the sticky menu enabled: http://screencast.com/t/WwiZxvu5cfv the images won’t be displayed on that post because a js error. To avoid that you can use this css in theme panel > custom code > custom css instead of php code: http://screencast.com/t/MGghSehQ
.postid-198 .td-header-menu-wrap {
display: none;
}
Just replace the id number with your post id.
Let me know how it goes.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Thank you, it works, but is there a way to do it with a whole category (to make the menu disappear in all posts in the category) so that I don’t have to do it every time I post something in the category?
Thanks
Hi,
@Healthills, please follow the same steps with single post and for category you have to use function below:
if ( ! in_category (array('cat-id','cat-id'))) { ?>
menu container
Here, http://screencast.com/t/dut2LkmLOy you can see how to find the category ID.
Please note that if you use this method and you have the sticky menu enabled: http://screencast.com/t/WwiZxvu5cfv the images won’t be displayed on that post because a js error.
@Hamzah, if you want to hide your main menu from particular page you have to use the page id that you want to hide.
Please try the code below in Theme panel->Custom Css area, like this: http://screencast.com/t/8hF2EXqv
.page-id-X .td-header-menu-wrap {
display:none;
}
Where X is your page ID. Here, http://screencast.com/t/S1qVQRbgFT you can see how to find the page ID.
For your second request, you can show different header ads in different page if you add some function in your ads.php file, like this: http://screencast.com/t/f7EsUBQq
if(is_page('page-id')){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
else {
echo td_global_blocks::get_instance('td_block_ad_box')->render(array('spot_id' => 'header'));
}
?>
If you want to show header ads only to front page, you have to use is_front_page() function. The custom ad you can find it in Theme panel-Ads -> http://screencast.com/t/NujAwoIjF
Hope this helps and let us know how it goes!
Thanks!
Hi, it works, but can I do the same thing with css? because my images don’t work.
Thanks
Hi
You can do it via css but is not a very efficient way as you need to add postid-x class for each post from which you want to remove the header. The images don’t appear because js call a class which was in header and because it can not find it, it generate an error. Please make sure that you don’t have the sticky menu activated: http://screencast.com/t/ZHgU2CjgJe and if the problem persist also disable the lazy load animation: http://screencast.com/t/UTgWnKWhaoj
Thanks!