Advertisement
bedas

Theme 2012 layouts integrated

Dec 16th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.41 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 (the other being style.css).
  7.  * It is used to display a page when nothing more specific matches a query.
  8.  * For example, it puts together the home page when no home.php file exists.
  9.  *
  10.  * @link https://codex.wordpress.org/Template_Hierarchy
  11.  *
  12.  * @package WordPress
  13.  * @subpackage Twenty_Twelve
  14.  * @since Twenty Twelve 1.0
  15.  */
  16. if ( defined( 'WPDDL_VERSION' ) && is_ddlayout_assigned() ) : // if Layouts Plugin is active and a layout is assigned
  17.         get_header( 'layouts' );
  18.         the_ddlayout( 'page-default' ); // Loads 'page-default' layout by default
  19.         get_footer( 'layouts' );
  20.     else: // if not use the normal WP loop
  21.  
  22.  
  23. get_header(); ?>
  24.  
  25.     <div id="primary" class="site-content">
  26.         <div id="content" role="main">
  27.         <?php if ( have_posts() ) : ?>
  28.  
  29.             <?php /* Start the Loop */ ?>
  30.             <?php while ( have_posts() ) : the_post(); ?>
  31.                 <?php get_template_part( 'content', get_post_format() ); ?>
  32.             <?php endwhile; ?>
  33.  
  34.             <?php twentytwelve_content_nav( 'nav-below' ); ?>
  35.  
  36.         <?php else : ?>
  37.  
  38.             <article id="post-0" class="post no-results not-found">
  39.  
  40.             <?php if ( current_user_can( 'edit_posts' ) ) :
  41.                 // Show a different message to a logged-in user who can add posts.
  42.             ?>
  43.                 <header class="entry-header">
  44.                     <h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
  45.                 </header>
  46.  
  47.                 <div class="entry-content">
  48.                     <p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
  49.                 </div><!-- .entry-content -->
  50.  
  51.             <?php else :
  52.                 // Show the default message to everyone else.
  53.             ?>
  54.                 <header class="entry-header">
  55.                     <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
  56.                 </header>
  57.  
  58.                 <div class="entry-content">
  59.                     <p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
  60.                     <?php get_search_form(); ?>
  61.                 </div><!-- .entry-content -->
  62.             <?php endif; // end current_user_can() check ?>
  63.  
  64.             </article><!-- #post-0 -->
  65.  
  66.         <?php endif; // end have_posts() check ?>
  67.  
  68.         </div><!-- #content -->
  69.     </div><!-- #primary -->
  70.  
  71. <?php get_sidebar(); ?>
  72. <?php get_footer();
  73.  
  74. endif; // IF Layouts are enabled
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement