Quote:
Originally Posted by Si
I've got a few things I have added into my site. That are using <?php include> tags.
One is in sidebar.php / one is in footer.php etc.
Problem is I only want to display these includes on the main page.
What's the best way to do it?
|
PHP Code:
<?php
wp_reset_query();
if (is_home() ) {
echo 'Put All Your Shit In Here';
}
?>
Alternatively, is something like this.
PHP Code:
<?php if (is_home()) { ?>
<h1><a href="<?php echo get_settings('home'); ?>/"><img src="<?php bloginfo('template_url'); ?>/images/logo.png" alt="<?php bloginfo('name'); ?>" /></a></h1>
<?php } else { ?>
<h4><a href="<?php echo get_settings('home'); ?>/"><img src="<?php bloginfo('template_url'); ?>/images/logo.png" alt="<?php bloginfo('name'); ?>" /></a></h4>
<?php } ?>
Here's a good way to pick out certain categories (for picking out and advertising only gay sites on gay/tranny as per this example)
PHP Code:
<?php
if (is_home() ) {
include(TEMPLATEPATH."/banner.php");
} else if ( is_category( 'gay-dicks' ) || post_is_in_descendant_category( 25 ) ) {
include(TEMPLATEPATH."/bangay.php");
} else if ( is_category( 'tranny' ) || post_is_in_descendant_category( 66 ) ) {
include(TEMPLATEPATH."/bantranny.php");
} else {
include(TEMPLATEPATH."/banner.php");
}
?>