ShapeShifter 2 Scrolling Homepage \"Page Template\" Snippet


/ Published in: PHP
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  1. <?php
  2. /*
  3.  * Template Name: Scrolling Homepage
  4. */
  5.  
  6. get_header();
  7. ?>
  8.  
  9.  
  10. <!-- Welcome Section -->
  11. <?php if(get_option_tree('include_welcome_section') == 'Yes' ) { ?>
  12. <?php get_template_part( 'element', 'welcomesection' ); ?>
  13. <?php } else {} ?>
  14. <!-- /Welcome Section -->
  15.  
  16.  
  17.  
  18. <?php
  19. if ( function_exists( 'get_option_tree' ) ) {
  20. if(get_option_tree('sidescroll_page_ids')) { //New checkpoint for 1.02
  21.  
  22. // set an array of page id's
  23. $ids = get_option_tree( 'sidescroll_page_ids', $theme_options, false, true, -1 );
  24. $id_string = join(',', $ids);
  25. }
  26. }
  27.  
  28. if(get_option_tree('sidescroll_page_ids')) { //New checkpoint for 1.02
  29.  
  30. $pages = get_pages( array(
  31. 'include' => $id_string,
  32. 'sort_column' => 'post_date',
  33. 'sort_order' => 'desc'
  34. ) );
  35.  
  36. foreach ($pages as $pagg) { setup_postdata($pagg); ?>
  37.  
  38. <div class="content_block slide_block">
  39.  
  40. <br class="clearfix" />
  41.  
  42. <a id="<?php echo($pagg->post_name)?>" name="<?php echo($pagg->post_name)?>" class="waypoint_marker"></a>
  43.  
  44.  
  45. <?php if(get_post_meta($pagg->ID,'page_caption')) : ?>
  46. <div id="page-header">
  47. <span class="supertagline" style="margin: 8px 0 20px;"><?php echo get_post_meta($pagg->ID,'page_caption',true); ?> </span>
  48. <br class="clear" />
  49. <hr class="partial-bottom" />
  50. </div>
  51. <?php endif; ?>
  52.  
  53. <?php if(get_post_meta($pagg->ID,'hide_title',true) == 'Yes') : else : ?>
  54. <h2 class="title"><span><?php echo($pagg->post_title)?></span></h2>
  55. <?php endif; ?>
  56.  
  57. <div class="content_body">
  58. <?php the_content(); ?>
  59. </div>
  60.  
  61. <br class="clearfix"/>
  62. <hr class="partial-bottom" />
  63.  
  64. </div>
  65.  
  66. <?php } } ?>
  67.  
  68.  
  69. <?php get_footer(); ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.