View Single Post
Old 11-22-2010, 08:47 AM  
Jdoughs
Confirmed User
 
Jdoughs's Avatar
 
Industry Role:
Join Date: Mar 2004
Location: Great White North
Posts: 5,794
Quote:
Originally Posted by Si View Post
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_category25 ) ) {
    include(
TEMPLATEPATH."/bangay.php");
} else if ( 
is_category'tranny' ) || post_is_in_descendant_category66 ) ) {
    include(
TEMPLATEPATH."/bantranny.php");
} else {
    include(
TEMPLATEPATH."/banner.php");
}
?>
__________________
LinkSpun - Premier Adult Link Trading Community - ICQ - 464/\281/\250
Be Seen By New Webmasters/Affiliates * Target out webmasters/affiliates based on niches your sites are for less than $20 a month.
AmeriNOC - Proudly hosted @ AmeriNOC!
Jdoughs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote