Advertisement
Guest User

page template page.php

a guest
Sep 25th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php
  4. $options = get_option('sf_flexform_options');
  5.  
  6. $default_show_page_heading = $options['default_show_page_heading'];
  7. $default_page_heading_bg_alt = $options['default_page_heading_bg_alt'];
  8. $default_sidebar_config = $options['default_sidebar_config'];
  9. $default_left_sidebar = $options['default_left_sidebar'];
  10. $default_right_sidebar = $options['default_right_sidebar'];
  11.  
  12. $show_page_title = get_post_meta($post->ID, 'sf_page_title', true);
  13. $page_title_one = get_post_meta($post->ID, 'sf_page_title_one', true);
  14. $page_title_two = get_post_meta($post->ID, 'sf_page_title_two', true);
  15. $page_title_bg = get_post_meta($post->ID, 'sf_page_title_bg', true);
  16.  
  17. if ($show_page_title == "") {
  18. $show_page_title = $default_show_page_heading;
  19. }
  20. if ($page_title_bg == "") {
  21. $page_title_bg = $default_page_heading_bg_alt;
  22. }
  23.  
  24. $sidebar_config = get_post_meta($post->ID, 'sf_sidebar_config', true);
  25. $left_sidebar = get_post_meta($post->ID, 'sf_left_sidebar', true);
  26. $right_sidebar = get_post_meta($post->ID, 'sf_right_sidebar', true);
  27.  
  28. if ($sidebar_config == "") {
  29. $sidebar_config = $default_sidebar_config;
  30. }
  31. if ($left_sidebar == "") {
  32. $left_sidebar = $default_left_sidebar;
  33. }
  34. if ($right_sidebar == "") {
  35. $right_sidebar = $default_right_sidebar;
  36. }
  37.  
  38. $page_wrap_class = '';
  39. if ($sidebar_config == "left-sidebar") {
  40. $page_wrap_class = 'has-left-sidebar has-one-sidebar row';
  41. } else if ($sidebar_config == "right-sidebar") {
  42. $page_wrap_class = 'has-right-sidebar has-one-sidebar row';
  43. } else if ($sidebar_config == "both-sidebars") {
  44. $page_wrap_class = 'has-both-sidebars';
  45. } else {
  46. $page_wrap_class = 'has-no-sidebar';
  47. }
  48.  
  49. $remove_breadcrumbs = get_post_meta($post->ID, 'sf_no_breadcrumbs', true);
  50. $remove_bottom_spacing = get_post_meta($post->ID, 'sf_no_bottom_spacing', true);
  51. $remove_top_spacing = get_post_meta($post->ID, 'sf_no_top_spacing', true);
  52.  
  53. if ($remove_bottom_spacing) {
  54. $page_wrap_class .= ' no-bottom-spacing';
  55. }
  56. if ($remove_top_spacing) {
  57. $page_wrap_class .= ' no-top-spacing';
  58. }
  59. ?>
  60.  
  61. <?php if (have_posts()) : the_post(); ?>
  62.  
  63. <?php if ($show_page_title) { ?>
  64. <div class="row">
  65. <div class="page-heading span12 clearfix alt-bg <?php echo $page_title_bg; ?>">
  66. <?php if ($page_title_one) { ?>
  67. <h1><?php echo $page_title_one; ?></h1>
  68. <?php } else { ?>
  69. <h1><?php the_title(); ?></h1>
  70. <?php } ?>
  71. <?php if ($page_title_one) { ?>
  72. <h3><?php echo $page_title_two; ?></h3>
  73. <?php } ?>
  74. </div>
  75. </div>
  76. <?php } ?>
  77.  
  78. <?php
  79. // BREADCRUMBS
  80. if(!$remove_breadcrumbs) {
  81. echo sf_breadcrumbs();
  82. } ?>
  83.  
  84. <div class="inner-page-wrap <?php echo $page_wrap_class; ?> clearfix">
  85.  
  86. <!-- OPEN page -->
  87. <?php if (($sidebar_config == "left-sidebar") || ($sidebar_config == "right-sidebar")) { ?>
  88. <div <?php post_class('clearfix span8'); ?> id="<?php the_ID(); ?>">
  89. <?php } else if ($sidebar_config == "both-sidebars") { ?>
  90. <div <?php post_class('clearfix row'); ?> id="<?php the_ID(); ?>">
  91. <?php } else { ?>
  92. <div <?php post_class('clearfix'); ?> id="<?php the_ID(); ?>">
  93. <?php } ?>
  94.  
  95. <?php if ($sidebar_config == "both-sidebars") { ?>
  96.  
  97. <div class="page-content span6">
  98. <?php the_content(); ?>
  99. </div>
  100.  
  101. <aside class="sidebar left-sidebar span3">
  102. <?php dynamic_sidebar($left_sidebar); ?>
  103. </aside>
  104.  
  105. <?php } else { ?>
  106.  
  107. <div class="page-content clearfix">
  108. <?php the_content(); ?>
  109. <div class="link-pages"><?php wp_link_pages(); ?></div>
  110. <div class="share-links clearfix">
  111. <div class="share-text"><?php _e("Share:", "swiftframework"); ?></div>
  112. <div class="share-buttons">
  113. <span class='st_facebook_hcount' displayText='Facebook'></span>
  114. <span class='st_twitter_hcount' displayText='Tweet'></span>
  115. <span class='st_googleplus_hcount' displayText='Google +'></span>
  116. <span class='st_linkedin_hcount' displayText='LinkedIn'></span>
  117. <span class='st_pinterest_hcount' displayText='Pinterest'></span>
  118. </div>
  119. <a class="permalink item-link" href="<?php the_permalink(); ?>"><i class="icon-link"></i></a>
  120. <a class="email-link item-link" href="mailto:?subject=<?php the_title(); ?>&amp;body=<?php the_permalink(); ?>" title="Share by Email"><i class="icon-envelope-alt"></i></a>
  121. </div>
  122.  
  123. </div>
  124.  
  125. <?php } ?>
  126. <?php if ( comments_open() ) { ?>
  127. <div id="comment-area">
  128. <?php comments_template('', true); ?>
  129. </div>
  130. <?php } ?>
  131.  
  132. <!-- CLOSE page -->
  133. </div>
  134.  
  135. <?php if ($sidebar_config == "left-sidebar") { ?>
  136.  
  137. <aside class="sidebar left-sidebar span4">
  138. <?php dynamic_sidebar($left_sidebar); ?>
  139. </aside>
  140.  
  141. <?php } else if ($sidebar_config == "right-sidebar") { ?>
  142.  
  143. <aside class="sidebar right-sidebar span4">
  144. <?php dynamic_sidebar($right_sidebar); ?>
  145. </aside>
  146.  
  147. <?php } else if ($sidebar_config == "both-sidebars") { ?>
  148.  
  149. <aside class="sidebar right-sidebar span3">
  150. <?php dynamic_sidebar($right_sidebar); ?>
  151. </aside>
  152.  
  153. <?php } ?>
  154.  
  155. </div>
  156.  
  157. <?php endif; ?>
  158.  
  159. <!--// WordPress Hook //-->
  160. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement