ShapeShifter 2滚动主页“页面模板”片段

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ShapeShifter 2滚动主页“页面模板”片段相关的知识,希望对你有一定的参考价值。

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.
  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(); ?>

以上是关于ShapeShifter 2滚动主页“页面模板”片段的主要内容,如果未能解决你的问题,请参考以下文章

css 使用与您的主页相似的小部件创建自定义页面模板

如何div滚动时主页面不跟着滚动?

Wordpress ACF 字段如何从自定义帖子类型中获取选项

具有捕捉全屏卡片的垂直 RecyclerView

如何在文件夹中创建自定义页面模板

堆叠模式在关闭时滚动主页[重复]