Advertisement
vman678

index.php

Sep 26th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.17 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The main template file.
  4.  *
  5.  * This is the most generic template file in a WordPress theme
  6.  * and one of the two required files for a theme
  7.  *
  8.  * @since alterna 1.0
  9.  */
  10.  
  11. get_header(); ?>
  12.    
  13.    <?php
  14.         if(((is_home() && !is_front_page()) || is_category()|| is_tag() || is_date()) && (intval(get_option('page_for_posts')) > 0) ) {
  15.             //when you use custom page for blog will use the page layout
  16.             $layout = alterna_get_page_layout(get_option('page_for_posts'));
  17.             $sidebar_name = get_post_meta(get_option('page_for_posts'), 'sidebar-type', true);
  18.         }else{
  19.             // index default will use global layout
  20.             $layout = alterna_get_page_layout('global');
  21.             $sidebar_name = '0';
  22.         }
  23.     ?>
  24.    
  25.     <div id="main" class="container">
  26.         <div class="row-fluid">
  27.             <?php if($layout == 2) : ?>
  28.                 <div class="span4"><?php generated_dynamic_sidebar($sidebar_name); ?></div>
  29.             <?php endif; ?>
  30.            
  31.             <div class="left-side <?php echo $layout == 1 ? 'span12' : 'span8'; ?>">
  32.                 <?php if ( have_posts() ) : ?>
  33.                    
  34.                     <?php /* Start the Loop */ ?>
  35.                     <?php while ( have_posts() ) : the_post(); ?>
  36.                         <?php get_template_part( 'content', get_post_format() );?>
  37.    
  38.                     <?php endwhile; ?>
  39.  
  40.                     <?php alterna_content_pagination('nav-bottom' , 'pagination-centered'); ?>
  41.                    
  42.                 <?php else : ?>
  43.  
  44.                 <article id="post-0" class="post no-results not-found">
  45.                     <header class="entry-header">
  46.                         <h1 class="entry-title"><?php _e( 'Nothing Found', 'alterna' ); ?></h1>
  47.                     </header><!-- .entry-header -->
  48.  
  49.                     <div class="entry-content">
  50.                         <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'alterna' ); ?></p>
  51.                         <?php get_search_form(); ?>
  52.                     </div><!-- .entry-content -->
  53.                 </article><!-- #post-0 -->
  54.  
  55.             <?php endif; ?>
  56.  
  57.             </div><!-- #left-side -->
  58.              <?php if($layout == 3) : ?>
  59.                 <div class="span4"><?php generated_dynamic_sidebar($sidebar_name); ?></div>
  60.             <?php endif; ?>
  61.         </div><!-- #row-fluid -->
  62.     </div><!-- #container -->
  63.        
  64. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement