Advertisement
Guest User

page.php

a guest
Apr 19th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.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 ($show_page_title) { ?>   
  62.     <div class="row">
  63.         <div class="page-heading span12 clearfix alt-bg <?php echo $page_title_bg; ?>">
  64.             <?php if ($page_title_one || $page_title_two) { ?>
  65.             <h1><?php echo $page_title_one; ?></h1>
  66.             <h3><?php echo $page_title_two; ?></h3>
  67.             <?php } else { ?>
  68.             <h1><?php the_title(); ?></h1>
  69.             <?php } ?>
  70.         </div>
  71.     </div>
  72. <?php } ?>
  73.  
  74. <?php
  75.     // BREADCRUMBS
  76.     if(!$remove_breadcrumbs) { 
  77.         echo sf_breadcrumbs();
  78. } ?>
  79.  
  80. <div class="inner-page-wrap <?php echo $page_wrap_class; ?> clearfix">
  81.        
  82.     <?php if (have_posts()) : the_post(); ?>
  83.  
  84.     <!-- OPEN page -->
  85.     <?php if (($sidebar_config == "left-sidebar") || ($sidebar_config == "right-sidebar")) { ?>
  86.     <div <?php post_class('clearfix span8'); ?> id="<?php the_ID(); ?>">
  87.     <?php } else if ($sidebar_config == "both-sidebars") { ?>
  88.     <div <?php post_class('clearfix row'); ?> id="<?php the_ID(); ?>">
  89.     <?php } else { ?>
  90.     <div <?php post_class('clearfix'); ?> id="<?php the_ID(); ?>">
  91.     <?php } ?>
  92.    
  93.         <?php if ($sidebar_config == "both-sidebars") { ?>
  94.            
  95.             <div class="page-content span6">
  96.                 <?php the_content(); ?>
  97.             </div>
  98.                
  99.             <aside class="sidebar left-sidebar span3">
  100.                 <?php dynamic_sidebar($left_sidebar); ?>
  101.             </aside>
  102.        
  103.         <?php } else { ?>
  104.        
  105.         <div class="page-content clearfix">
  106.  
  107.             <?php the_content(); ?>
  108.            
  109.         </div>
  110.        
  111.         <?php } ?> 
  112.    
  113.     <!-- CLOSE page -->
  114.     </div>
  115.  
  116.     <?php endif; ?>
  117.    
  118.     <?php if ($sidebar_config == "left-sidebar") { ?>
  119.        
  120.         <aside class="sidebar left-sidebar span4">
  121.             <?php dynamic_sidebar($left_sidebar); ?>
  122.         </aside>
  123.  
  124.     <?php } else if ($sidebar_config == "right-sidebar") { ?>
  125.        
  126.         <aside class="sidebar right-sidebar span4">
  127.             <?php dynamic_sidebar($right_sidebar); ?>
  128.         </aside>
  129.        
  130.     <?php } else if ($sidebar_config == "both-sidebars") { ?>
  131.        
  132.         <aside class="sidebar right-sidebar span3">
  133.             <?php dynamic_sidebar($right_sidebar); ?>
  134.         </aside>
  135.    
  136.     <?php } ?>
  137.  
  138. </div>
  139.  
  140. <!--// WordPress Hook //-->
  141. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement