Advertisement
Guest User

news

a guest
Sep 14th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The main template file.
  4.  *
  5.  * Template name: News-Benelux
  6.  *
  7.  * This is the most generic template file in a WordPress theme
  8.  * and one of the two required files for a theme (the other being style.css).
  9.  * It is used to display a page when nothing more specific matches a query.
  10.  * E.g., it puts together the home page when no home.php file exists.
  11.  * Learn more: http://codex.wordpress.org/Template_Hierarchy
  12.  *
  13.  * @package sparkling
  14.  */
  15.  
  16. get_header('slider'); ?>
  17.  
  18.     <div id="primary" class="content-area">
  19.  
  20.         <main id="main" class="site-main" role="main">
  21.  
  22.             <?php
  23.             $args = array( 'post_type' =>   'post',                        
  24.                            'category_name' =>    'benelux-news',                    
  25.                            'posts_per_page' =>  6,
  26.                            'paged' =>  $paged   );
  27.             query_posts( $args );
  28.             ?>
  29.            
  30.                   <?php global $region; /* global $wp_query;
  31.                 $explode = explode('/', $wp_query->query['pagename']);
  32.                 $region = $explode[0];
  33.                 $args = array(
  34.                    'category_name' => $region,
  35.                    'posts_per_page'=> 6,);
  36.                    query_posts( $args );
  37.         ?><?php */?>
  38.        
  39. <?php /*?>        <?php global $region;
  40.     $args = array(
  41.         'category_name' => $region,
  42.         'posts_per_page'=> 6,
  43.     );
  44.     query_posts( $args );
  45. ?><?php */?>
  46.        
  47.  
  48.        
  49.        
  50.         <?php /* Start the Loop */ ?>  
  51.         <?php while ( have_posts() ) : the_post(); ?>
  52.        
  53.                 <?php get_template_part( 'template-parts/content', get_post_format() ); ?>
  54.  
  55.             <?php endwhile; // end of the loop. ?>
  56.  
  57.                 <?php sparkling_paging_nav(); ?>
  58.  
  59.         </main><!-- #main -->
  60.     </div><!-- #primary -->
  61.  
  62. <?php get_sidebar( $region ); ?>
  63. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement