Hello All, I am looking to display parts of my sidebar on my homepage only and other parts only when a person navigates away from my homepage. To do this I was thinking that an PHP if statement should be used, however I don't know what wordpress function will be used with this. For Example: <? PHP if <Wordpress Homepage Function> ?>{ PHP: Hompage Content Only } <? PHP else ?>{ PHP: NON-HOMEPAGE CONTENT } <? PHP Endif ?> PHP: Any Suggestions? Best Regards, Nick
Hey All, Here is the code for the sidebar: <div id="sidebar"> <div id="sidebar-top"> <h3>Weekly Poker Training</h3> <div id="sidebar-content"> <?php query_posts("showposts=2&cat=25"); $i = 1; ?> <?php while (have_posts()) : the_post(); ?> <div class="clearfloat"> <?php $values = get_post_custom_values("Image"); if (isset($values[0])) { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>&w=100&h=65&zc=1&q=100" alt="<?php the_title(); ?>" class="left" width="100px" height="65px" /></a> <?php } ?> <div class="info"> <a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php the_title(); ?></a> <div class="meta"> [<?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?>] </div> <?php the_excerpt(); ?> </div> </div> <?php endwhile; ?> <?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?> <?php endif; ?> </div> </div> <div id="sidebar-ads"> <a href="http://www.outplaypoker.com"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/banners/sidebar-banner.png" alt="Outplay Poker Store" width="300px" height="250px" /></a> </div> <div id="sidebar-bottom"> <?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(4) ) : ?> <?php endif; ?> </div> </div> PHP:
Try this code. <?php if ( is_home() ) { // This is a homepage } else { // This is not a homepage } ?> Code (markup): More conditionals tags. http://codex.wordpress.org/Category:Conditional_Tags hope that helps