2014-10-22, 14:10:04
Thank you for reply.
I want the Sidebar component to be present on all pages but on a few selected ones.
So far I discovered that:
if I comment out <?php get_component('sidebar'); ?>
and I add <?php if (return_page_slug()!='index') get_component('Sidebar'); ?>
I will get the Sidebar on all pages BUT index.
Now, if I want to remove the Sidebar from yet another page, my logic tells me that I should add another:
<?php if (return_page_slug()!='another_page') get_component('Sidebar'); ?>
But, if I do that, the Sidebar will be doubled on all pages and will appear once an the pages I want it removed.
One thing that does the trick is:
<?php if (return_page_slug()=='index') get_component('Sidebar'); ?>
<?php if (return_page_slug()=='another_page') get_component('Sidebar'); ?>
This way I will only get the Sidebar on those two pages but it is a bit hard to implement when one has a lot of pages
Did I get it right?
I want the Sidebar component to be present on all pages but on a few selected ones.
So far I discovered that:
if I comment out <?php get_component('sidebar'); ?>
and I add <?php if (return_page_slug()!='index') get_component('Sidebar'); ?>
I will get the Sidebar on all pages BUT index.
Now, if I want to remove the Sidebar from yet another page, my logic tells me that I should add another:
<?php if (return_page_slug()!='another_page') get_component('Sidebar'); ?>
But, if I do that, the Sidebar will be doubled on all pages and will appear once an the pages I want it removed.
One thing that does the trick is:
<?php if (return_page_slug()=='index') get_component('Sidebar'); ?>
<?php if (return_page_slug()=='another_page') get_component('Sidebar'); ?>
This way I will only get the Sidebar on those two pages but it is a bit hard to implement when one has a lot of pages
Did I get it right?