/ Published in: PHP
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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?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(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 ); } } if(get_option_tree('sidescroll_page_ids')) { //New checkpoint for 1.02 '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(); ?>