• I am using the following code to pull custom post type “rotatingfeature” into the coda slider “feature” area in a website. The div #banner_section extends the full width of the page & is currently inline-styled with a bg-color. What I would like to do is allow the admin to change the color of each rotatingfeature background so that the feature appears to extend the full width of the page, and not appear contained in the .coda-slider-wrapper. I have already setup a custom field for them to enter the hex code of the bleed in the rotatingfeature post page, but how can I enable this section on the front-end with the #banner_section being outside of the query?

    <div id="banner_section" style="background-color:#b8cfd5;">
    
    	<div class="banner_section_cotent">
    		<script type="text/javascript">
    				$().ready(function() {
    					$('#coda-slider-1').codaSlider({
    			     		autoSlide: true,
    					    autoSlideInterval: 5000,
    					    autoSlideStopWhenClicked: true,
    						autoHeight: false,
    						dynamicArrowLeftText: "<img src='<?php bloginfo('template_url')?>/images/previous.png' />",
    						dynamicArrowRightText: "<img src='<?php bloginfo('template_url')?>/images/next.png' />",
    						dynamicTabs: false
    			    });
    				});
    		</script>
    		<div class="coda-slider-wrapper">
    		  <div class="coda-slider preload" id="coda-slider-1">
    
    			<?php
    			$args=array(
    			  'post_type' => 'rotatingfeature',
    			  'post_status' => 'publish',
    			  'order' => 'ASC',
    			  'orderby' => 'menu_order',
    			  'posts_per_page' => -1,
    			  'caller_get_posts'=> 1
    			);
    			$my_query = null;
    			$my_query = new WP_Query($args);
    			if( $my_query->have_posts() ) {
    			  while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    			    <div class="panel">
    			        <div class="panel-wrapper" style="position:relative;">
    			        	<div class="thumbnail" style="position:absolute;z-index:90;"><a href="<?php the_field('ad_url'); ?>"><?php the_post_thumbnail();?></a></div>
    			        </div>
    			    </div>
    
    		    <?php
    		  endwhile;
    		}
    		wp_reset_query();  // Restore global post data stomped by the_post().
    		?>	
    
    		</div><!-- .coda-slider -->
    	</div><!-- .coda-slider-wrapper -->
    </div><!-- banner_section -->
    </div><!-- banner_section_content -->

    I realize this could be incredibly confusing. Please let me know if this makes sense so I don’t waste anyone’s time. Thanks! ??

  • The topic ‘Custom Field outside of Loop?’ is closed to new replies.