• Hi,
    Is there a way to modify this code in order to hide a sidebar?
    I want to display “recent posts” on entire page.

    <?php get_header(); ?>
    
    	<?php // Show/Hide the slider?
    
    	$hide_slider = (of_get_option('js_homepage_slider') ? of_get_option('js_homepage_slider') : 0);
    	if (!$hide_slider){
    
    		// Get Featured Gallery Items
    		$gallery_items = get_homepage_slides();
    
    		// Display gallery if there are any items to display
    		if ($gallery_items){ ?>
    		<div class="large-gallery"<?php if (of_get_option('js_homepage_content') == 'nothing'){ ?> style="margin:0;"<?php } ?>>
    			<div class="images">
    				<?php echo $gallery_items; ?>
    			</div>
    			<div class="hovers">
    				<span class="hover-layer"></span>
    				<span class="hover-link" href="#"></span>
    			</div>
    			<span class="caption"></span>
    			<a href="#"></a>
    			<a href="#"></a><a href="#"></a>
    			<div class="pagination"></div>
    		</div>
    		<?php } ?>
    
    		<script type="text/javascript">
    			// Set up some variables
    			var slideSpeed = <?php echo (of_get_option('js_homepage_slider_speed') ? of_get_option('js_homepage_slider_speed') : 6); ?>;
    			var autoCycle = '<?php echo (of_get_option('js_homepage_slider_cycle') ? of_get_option('js_homepage_slider_cycle') : 'yes'); ?>';
    			var slideType = '<?php echo (of_get_option('js_homepage_slider_type') ? of_get_option('js_homepage_slider_type') : 'slide'); ?>';
    			var transitionSpeed = <?php echo (of_get_option('js_homepage_slider_transition_speed') ? of_get_option('js_homepage_slider_transition_speed') : 500); ?>;
    			var clickableSlides = '<?php echo (of_get_option('js_homepage_slides_linked') ? of_get_option('js_homepage_slides_linked') : 'yes'); ?>';
    		</script>
    		<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.gallery-large.js"></script>
    
    	<?php } //End Hide/Show slider ?>
    
    	<?php if (of_get_option('js_homepage_content') != 'nothing'){ ?>
    		<div id="content" class="sidebar-<?php echo (of_get_option('js_sidebar_position') ? of_get_option('js_sidebar_position') : 'right'); ?>">
    			<article class="post">
    				<h2 class="section-title"><?php
    					echo (of_get_option('js_homepage_section_title') ? of_get_option('js_homepage_section_title') : 'Recent Photos');
    				?></h2>
    
    				<?php // Gallery or Posts
    
    				if (of_get_option('js_homepage_content') == 'posts'){				
    
    					// Detect the set number of posts per page
    					$number_of_posts = of_get_option('js_homepage_number');
    					$posts_cat = of_get_option('js_homepage_posts_cat');
    
    					$wp_query = new WP_Query(
    				        array(
    				            'posts_per_page'=>$number_of_posts,
    				            'orderby'=>'date',
    				            'cat'=>$posts_cat
    				        )
    				    );
    
    					// The Loop
    					while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
    
    						<h2 id="post-<?php the_ID(); ?>" class="post-title"><a>"><?php the_title(); ?></a></h2>
    
    						<?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>
    
    						<div class="entry">
    							<a>"><?php the_post_thumbnail('post'); ?></a>
    							<?php the_content('<span class="read-more">READ MORE</span>'); ?>
    						</div>
    
    					<?php endwhile; ?>
    
    				<?php } else { ?>
    
    					<div class="medium-gallery">
    
    						<?php
    
    						// Get Featured Gallery Items
    						$gallery_items = '';
    
    						// Detect the set number of posts per page
    						$number_of_posts = of_get_option('js_homepage_number');
    						$gallery_cat = of_get_option('js_homepage_gallery_cat');
    
    						if ($gallery_cat) {
    							$taxonomy_array = array(
    				            	array(
    				            		'taxonomy' => 'galleries',
    				            		'field' => 'id',
    				            		'terms' => $gallery_cat
    				            	));
    					   	} else {
    					   		$taxonomy_array = '';
    					   	}
    
    					    $wp_query = new WP_Query(
    					        array(
    					            'post_type'=>'gallery-items',
    					            'posts_per_page'=>$number_of_posts,
    					            'orderby'=>'date',
    					            'tax_query'=> $taxonomy_array
    					        )
    					    );
    
    						// The Loop
    						while ( $wp_query->have_posts() ) : $wp_query->the_post();
    
    							$thumbnail_image_src = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post->ID ),'medium');
    							$thumbnail_image_src = $thumbnail_image_src[0];
    							$image_title = addslashes(get_the_title($post->ID));
    
    							js_display_gallery_item($thumbnail_image_src,$image_title,get_permalink($post->ID));
    
    						endwhile;
    						?><div class="cl"></div>
    
    					</div>
    
    				<?php } wp_reset_query(); // END Gallery or Posts ?>
    
    				<?php if (of_get_option('js_homepage_button_link')){ ?>
    				<div class="js-paginate top-right-link">
    					<a>" class="js-page"><?php
    						echo (of_get_option('js_homepage_button_text') ? of_get_option('js_homepage_button_text') : 'View All');
    					?></a>
    					<div class="cl"></div>
    				</div>
    				<?php } ?>
    
    			</article>
    
    			<aside>
    
    <?php get_sidebar('homepage'); ?>
    			</aside>
    
    			<div class="cl"></div>
    		</div>
    	<?php } ?>
    
    <?php get_footer(); ?>

    Thank You

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Removing sidebar from my homepage’ is closed to new replies.