2014-10-22, 17:46:33
(2014-10-22, 14:10:04)inteq Wrote: 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
You can use the in_array() function to make it more slim.
First you create an array with your "blacklist-slugs", where no sidebar will be shown (or "whitelist-slugs", depends on what is less input):
PHP Code:
$noSidebar = array('page_without_sidebar1','page_without_sidebar2','page_without_sidebar3');
PHP Code:
if( !in_array(return_page_slug(), $noSidebar) ) {
get_component('Sidebar');
}