Advertisement
catchmahesh

page.php

Jun 4th, 2017
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.50 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying all pages
  4.  *
  5.  * This is the template that displays all pages by default.
  6.  * Please note that this is the WordPress construct of pages
  7.  * and that other 'pages' on your WordPress site will use a
  8.  * different template.
  9.  *
  10.  * @package Catch Themes
  11.  * @subpackage Gridalicious
  12.  * @since Gridalicious 1.0
  13.  */
  14.  
  15. get_header(); ?>
  16.  
  17.     <main id="main" class="site-main" role="main">
  18.  
  19.         <?php if(is_front_page() ):
  20.             $args = array (
  21.                 'post_type' => 'post',
  22.                 'category_name' => 'aciform'
  23.             );
  24.  
  25.             $front_page_query = new WP_Query( $args );
  26.  
  27.             ?>
  28.  
  29.  
  30.             <?php if ( $front_page_query->have_posts() ) :
  31.                 while ( $front_page_query->have_posts() ) : $front_page_query->the_post();
  32.                   // Code for displaying the post
  33.                 ?>
  34.                 <?php include(locate_template( 'content-cat.php', false, false )); ?>
  35.                   <?php //get_template_part( 'content', 'cat' ); ?><!-- .entry-content -->
  36.             <?php
  37.                endwhile;
  38.  
  39.                wp_reset_postdata();
  40.  
  41.             else:
  42.  
  43.                // No Posts Found Code
  44.  
  45.             endif;
  46.  
  47.         endif; //is_front_page end
  48.  
  49.     ?>
  50.  
  51.         <?php while ( have_posts() ) : the_post(); ?>
  52.  
  53.             <?php get_template_part( 'content', 'page' ); ?>
  54.  
  55.             <?php
  56.                 /**
  57.                  * gridalicious_comment_section hook
  58.                  *
  59.                  * @hooked gridalicious_get_comment_section - 10
  60.                  */
  61.                 do_action( 'gridalicious_comment_section' );
  62.             ?>
  63.  
  64.         <?php endwhile; // end of the loop. ?>
  65.  
  66.     </main><!-- #main -->
  67.  
  68. <?php get_sidebar(); ?>
  69. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement