Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter whitehousej

    (@whitehousej)

    Ok people after an exhaustive trial and error exercise, I’ve narrowed the problem down to my usage of query_posts() in the top (ignoring the debugging echos) if statement. I’m using query_posts() to display the last post in the category news, then a bit of html, then the last post in category casestudies. This then causes the bottom echo, testing is_home() to fail even though the top one passes. I have read the codex on query_posts() but have to say I’m still at a loss as to solving the problem. Does anyone have any suggestions?

    Cheers,
    Jim

    Thread Starter whitehousej

    (@whitehousej)

    Ignore the formatting and what not, the theme is a work in progress. This is just the contents of the index.php file. You’ll notice there’s an if-else before the main body of content and an if-else afterward just containing echo’s. The first one outputs HOMEPAGE and the second one doesn’t. Any thoughts, greatly appreciated.

    <?php
    get_header();
    if (is_front_page() || is_home()) echo 'HOMEPAGE';
    else echo 'HMM NOT HOMEPAGE';
    // IF [homepage]
    if (is_front_page() || is_home()) {
    	$controlPanel = get_option('controlPanel'); ?>
    	<script type="text/javascript">
    		//swfobject.embedSWF('<?php bloginfo('template_directory'); ?>/assets/flash/introduction.swf', 'flash', '495', '240', '9.0.0', {}, {title: '<?php echo $controlPanel['homepageFlashText']; ?>'}, {});
    	</script>
    	<img id="flash" class="screen" src="<?php bloginfo('template_directory'); ?>/assets/images/noFlash.png" alt="<?php echo stripslashes($controlPanel['homepageFlashText']); ?>" width="495px" height="240px" />
    	<p id="introduction"><?php echo stripslashes($controlPanel['homepageIntroduction']); ?></p>
    	<h3>Latest News</h3>
    	<?php query_posts('showposts=1&category_name=news');
    	global $more;
    	$more = 0;
    	if (have_posts()) :
    		while (have_posts()) : the_post(); ?>
    			<div class="post split">
    				<div class="image">
    					<div class="container">
    						<img src="<?php echo get_bloginfo('url').'/'.get_option('upload_path').'/'.get_post_meta($post->ID, 'thumbnail', true); ?>" alt="<?php the_title(); ?>" />
    					</div>
    				</div>
    				<div class="text">
    					<h3><?php the_title(); ?></h3>
    					<?php the_content('Read More'); ?>
    					<p class="date"><?php the_time('F j, Y'); ?> at <?php the_time('G:i'); ?></p>
    				</div>
    			</div>
    		<?php endwhile;
    	else: ?>
    	<div class="post">
    		<p>There are currently no news items to display.</p>
    	</div>
    	<?php endif; ?>
    	<h3>Case Studies</h3>
    	<?php query_posts('showposts=1&category_name=casestudies');
    	global $more;
    	$more = 0;
    	if (have_posts()) :
    		while (have_posts()) : the_post(); ?>
    			<div class="post split">
    				<div class="image">
    					thumbnail here
    				</div>
    				<div class="text">
    					<h3><?php the_title(); ?></h3>
    					<?php the_content('Read More'); ?>
    					<p class="date"><?php the_time('F j, Y'); ?> at <?php the_time('G:i'); ?></p>
    				</div>
    			</div>
    		<?php endwhile;
    	else: ?>
    	<div class="post">
    		<p>There are currently no case studies to display.</p>
    	</div>
    	<?php endif;
    // IF [static page]
    } else if (is_page()) {
    	if (have_posts()) :
    		while (have_posts()) : the_post(); ?>
    			<div id="banner">
    				<h2><?php the_title(); ?></h2>
    				<?php $site->breadcrumbs($post, null); ?>
    			</div>
    			<?php $site->subpages($post);
    			the_content();
    		endwhile;
    	endif;
    
    // IF [single post]
    } else if (is_single()) {
    	if (have_posts()) :
    		while (have_posts()) : the_post(); ?>
    			<div id="banner">
    				<h2><?php the_title(); ?></h2>
    				<?php $site->breadcrumbs($post, get_the_category()); ?>
    			</div>
    			<?php the_content(); ?>
    			<p class="date"><?php the_time('F j, Y'); ?> at <?php the_time('G:i'); ?></p>
    		<?php endwhile;
    	endif;
    }
    if (is_front_page() || is_home()) echo 'HOMEPAGE';
    else echo 'HMM NOT HOMEPAGE';
    get_footer();
    ?>
    Thread Starter whitehousej

    (@whitehousej)

    Nope, not using a static page for the homepage.

    Thread Starter whitehousej

    (@whitehousej)

    ?? That throws my theory out the window then. Do you have any suggestion on what might be causing my use of is_home in the footer.php to break then?

Viewing 4 replies - 1 through 4 (of 4 total)