Return to Snippet

Revision: 57422
at May 25, 2012 06:22 by Makedesign


Updated Code
<?php
/*
 * Template Name: Scrolling Homepage
*/

get_header();
?>


<!-- Welcome Section -->
<?php if(get_option_tree('include_welcome_section') == 'Yes' ) { ?>
	<?php get_template_part( 'element', 'welcomesection' ); ?>
<?php } else {} ?>	
<!-- /Welcome Section -->


		
<?php
if ( function_exists( 'get_option_tree' ) ) {
	if(get_option_tree('sidescroll_page_ids')) { //New checkpoint for 1.02
		
	  // set an array of page id's
	  $ids = get_option_tree( 'sidescroll_page_ids', $theme_options, false, true, -1 );
	  $id_string = join(',', $ids);
  }
}

if(get_option_tree('sidescroll_page_ids')) { //New checkpoint for 1.02
	
	$pages = get_pages( array( 
			'include' => $id_string, 
			'sort_column' => 'post_date',
			'sort_order' => 'desc'
		) );
		
	foreach ($pages as $pagg) { setup_postdata($pagg); ?>
	
	<div class="content_block slide_block">
	
		<br class="clearfix" />
		
		<a id="<?php echo($pagg->post_name)?>" name="<?php echo($pagg->post_name)?>" class="waypoint_marker"></a>
		
		
		<?php if(get_post_meta($pagg->ID,'page_caption')) : ?>
			<div id="page-header">
				<span class="supertagline" style="margin: 8px 0 20px;"><?php echo get_post_meta($pagg->ID,'page_caption',true); ?> </span>
				<br class="clear" />
				<hr class="partial-bottom" />
			</div>
		<?php endif; ?>
		
		<?php if(get_post_meta($pagg->ID,'hide_title',true) == 'Yes') : else : ?>
			<h2 class="title"><span><?php echo($pagg->post_title)?></span></h2>
		<?php endif; ?>
		 
		<div class="content_body">
			<?php the_content(); ?>
		</div>
		
		<br class="clearfix"/>
		<hr class="partial-bottom" />
	
	</div>

<?php }  } ?>


<?php get_footer(); ?>

Revision: 57421
at May 25, 2012 06:21 by Makedesign


Initial Code
<?php get_header(); ?>


<!-- Welcome Section -->
<?php if(get_option_tree('include_welcome_section') == 'Yes' ) { ?>
	<?php get_template_part( 'element', 'welcomesection' ); ?>
<?php } else {} ?>	
<!-- /Welcome Section -->


		
<?php
if ( function_exists( 'get_option_tree' ) ) {
	if(get_option_tree('sidescroll_page_ids')) { //New checkpoint for 1.02
		
	  // set an array of page id's
	  $ids = get_option_tree( 'sidescroll_page_ids', $theme_options, false, true, -1 );
	  $id_string = join(',', $ids);
  }
}

if(get_option_tree('sidescroll_page_ids')) { //New checkpoint for 1.02
	
	$pages = get_pages( array( 
			'include' => $id_string, 
			'sort_column' => 'post_date',
			'sort_order' => 'desc'
		) );
		
	foreach ($pages as $pagg) { setup_postdata($pagg); ?>
	
	<div class="content_block slide_block">
	
		<br class="clearfix" />
		
		<a id="<?php echo($pagg->post_name)?>" name="<?php echo($pagg->post_name)?>" class="waypoint_marker"></a>
		
		
		<?php if(get_post_meta($pagg->ID,'page_caption')) : ?>
			<div id="page-header">
				<span class="supertagline" style="margin: 8px 0 20px;"><?php echo get_post_meta($pagg->ID,'page_caption',true); ?> </span>
				<br class="clear" />
				<hr class="partial-bottom" />
			</div>
		<?php endif; ?>
		
		<?php if(get_post_meta($pagg->ID,'hide_title',true) == 'Yes') : else : ?>
			<h2 class="title"><span><?php echo($pagg->post_title)?></span></h2>
		<?php endif; ?>
		 
		<div class="content_body">
			<?php the_content(); ?>
		</div>
		
		<br class="clearfix"/>
		<hr class="partial-bottom" />
	
	</div>

<?php }  } ?>


<?php get_footer(); ?>

Initial URL

                                

Initial Description
Adding a file named "template-homepage.php" and adding this code inside it should essentially create a page template named "Scrolling Homepage" to your theme, which is useful in some customized landing page situations where you want another page as the landing page and still be able to use the theme's custom scrolling template.

Initial Title
ShapeShifter 2 Scrolling Homepage \"Page Template\" Snippet

Initial Tags
wordpress

Initial Language
PHP