• Resolved jarvo1980

    (@jarvo1980)


    Hi All,

    Really hope someone can help. I’ve a block of code (below) which tests what page your on. If it’s the home page it shows a slide show, if its another set page it shows an image from a set post, otherwise it shows the image set by a header image plugin.

    It all works well. I now want to test if you’re on the home page or 1 other page, show the slide show. Unfortunately, it wont work. If I check the source code, I can see it’s generating everything but won’t show on screen.

    Any ideas?

    Here’s the code:

    <!-- header_image -->
    	  <div id="header_image">
    	  <?php
    	  $pageURL='';
    	  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    	  $filename = basename($pageURL);
    	  if ( ($filename == '?ec3_today=1') || (is_front_page() ) ) {
    	  ?>
    		<!-- loopSlider -->
    		<div id="loopedSlider">
    		  <div class="container">
    			<div class="slides">
    			<?php query_posts('category_name=featured'); ?>
    			<?php $i=1; ?>
    			<?php while (have_posts()) : the_post(); ?>
    			  <div>
    				<div id="dynamic_content_wrapper">
    				  <h2><?php the_title(); ?></h2>
    				  <h3><?php $key="Venue"; echo get_post_meta($post->ID, $key, true); ?>, <?php $key="Town"; echo get_post_meta($post->ID, $key, true); ?></h3>
    				  <p><?php $key="Date"; echo get_post_meta($post->ID, $key, true); ?></p>
    				</div>
    			    <?php $Banner_Ad = get_post_meta($post->ID, 'Banner_Ad', true);
    				echo wp_get_attachment_image($Banner_Ad, 'medium'); ?>
    			  </div>
    			<?php endwhile;?>
    			<?php wp_reset_query(); ?>
    			</div>
    		  </div>
    		  <div id="dynamic_pagination">
    			<!--<a href="#" class="previous">previous</a>
    			<a href="#" class="next">next</a>-->
    			<ul class="pagination">
    			  <?php query_posts('category_name=featured'); ?>
    			  <?php $i=1; ?>
    			  <?php while (have_posts()) : the_post(); ?>
    			  <?php echo '<li><a href="#">'.$i.'</a></li>';
    			    $i++;
    			   ?>
    			  <?php endwhile;?>
    			  <?php wp_reset_query(); ?>
    			</ul>
    		  </div>
    		</div>
    		<!-- /loopSlider -->
    	  <?php
    	  } elseif ($filename == '?ec3_listing=all') {
    
    		$Banner_Ad = get_post_meta(80, 'Banner_Ad', true);
    		$field_one = get_post_meta(80, "Banner_Ad", true );
    		if( ( $field_one && '' != $field_one ) ) :
    			echo wp_get_attachment_image($Banner_Ad, 'medium');
    		endif;	
    
    	  } else {
    
    		if(function_exists('show_media_header')){
    		  show_media_header();
    		}		
    
    	  }
    	  ?>
    	  </div>
    	  <!-- /header_image -->

    Thanks in advanced

Viewing 1 replies (of 1 total)
  • Thread Starter jarvo1980

    (@jarvo1980)

    Sorted it. Totally forgot the slider used some script at the footer of the page, needless to say, I needed to alter my footer file too to check the page and add the code if needs be – am so embarassed!

Viewing 1 replies (of 1 total)
  • The topic ‘block of code shows in source, now screen output’ is closed to new replies.