Forums

Conditional Sidebar not recognizing home page (3 posts)

  1. adiofm
    Member
    Posted 2 years ago #

    My logic is this:

    If it's the homepage, show the side bar a specific way (with added code) if it's not the homepage just use the dynamic sidebar. The problem I'm having is that it doesn't recognize that it's on the home page. I'm using a static page called Home set in Settings>>Reading within the wordpress options.

    Here's my code:

    <?php if ( is_front_page() ) { ?>	
    
    			<div id="portfolio">
    
    		<div class="title">
    			<div class="fix"></div>
    		</div><!-- /title -->
    
    		<?php $counter = 0; ?>
    		<?php query_posts('cat=' . $GLOBALS[portfolio_cat] . '&showposts=' . get_option('woo_portfolio_posts') ); ?>
    
    		<?php if (have_posts()) :  while (have_posts()) : the_post(); $counter++; ?>
    
    		<?php
    
       		$layout = ('1col.php');
    
    			include( TEMPLATEPATH . '/portfolio-layouts/' . $layout );
    
    		?>
    
    		<?php endwhile; endif; ?>
    
    		<div class="fix"></div>
    
    	</div>
    
    	<?php } else { ?>
    
                <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar(1) )  ?>		           
    
    	<?php } ?>
  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Try:

    <?php if ( is_front_page() || is_home() ) { ?>

  3. adiofm
    Member
    Posted 2 years ago #

    Just tried your suggestion esmi.

    It still just doesn't recognize that it's on the page.

Topic Closed

This topic has been closed to new replies.

About this Topic