Advertisement
Guest User

index.php wordpress twentyseventeen

a guest
Feb 7th, 2017
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.21 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.  * E.g., 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_Seventeen
  14.  * @since 1.0
  15.  * @version 1.0
  16.  */
  17.  
  18. get_header(); ?>
  19.  
  20. <div class="wrap">
  21.     <?php if ( is_home() && ! is_front_page() ) : ?>
  22.         <header class="page-header">
  23.             <h1 class="page-title"><?php single_post_title(); ?></h1>
  24.         </header>
  25.     <?php else : ?>
  26.     <header class="page-header">
  27.         <h2 class="page-title"><?php _e( 'Posts', 'twentyseventeen' ); ?></h2>
  28.     </header>
  29.     <?php endif; ?>
  30.  
  31.     <div id="primary" class="content-area">
  32.         <main id="main" class="site-main" role="main">
  33.  
  34.             <?php
  35.             // The Args
  36.             $args = array(
  37.                 'category__not_in' => array(18)
  38.             );
  39.             // The Query
  40.             query_posts( $args );
  41.  
  42.             if ( have_posts() ) :
  43.  
  44.                 /* Start the Loop */
  45.                 while ( have_posts() ) : the_post();
  46.  
  47.                     /*
  48.                      * Include the Post-Format-specific template for the content.
  49.                      * If you want to override this in a child theme, then include a file
  50.                      * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  51.                      */
  52.                     get_template_part( 'template-parts/post/content', get_post_format() );
  53.  
  54.                 endwhile;
  55.  
  56.                 the_posts_pagination( array(
  57.                     'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
  58.                     'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
  59.                     'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
  60.                 ) );
  61.  
  62.             else :
  63.  
  64.                 get_template_part( 'template-parts/post/content', 'none' );
  65.  
  66.             endif;
  67.             ?>
  68.  
  69.         </main><!-- #main -->
  70.     </div><!-- #primary -->
  71.     <?php get_sidebar(); ?>
  72. </div><!-- .wrap -->
  73.  
  74. <?php get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement