Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hiding a Component on Homepage / index.php
#1
Hi there,

is there any way to load a specific component on every site except the index / homepage / startscreen?
I do'nt need breadcrumbs on index /homepage, so i only want to display them on "subpages" of index.

Got no PHP-Skillz. :-(

Thanks & Greetings,
Rob
:-)
Reply
#2
Edit your template and change:
Code:
<?php get_component('mycomponent'); ?>
to:
Code:
<?php if (return_page_slug()!='index') get_component('mycomponent'); ?>

Or else, edit the component and enclose its contents between these code:
Code:
<?php if (return_page_slug()!='index') { ?>
... component content ...
<?php } ?>
Reply
#3
More easier would be to make a seperate template and choose this template under the pageoptions of the indexpage
Reply
#4
@m1k3y

Yes, you're right. I forgot to mention that other solution.

(However I personally don't like that way, because if I have to do some change to the template, I must do it in both files - unless I split them in pieces with common code and use includes, like the Innovation theme does.)
Reply




Users browsing this thread: 1 Guest(s)