Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.63 KB | None | 0 0
  1. <?php
  2. /**
  3. * The Default Page Template for Strong
  4. *
  5. * Displays the Pages.
  6. *
  7. * @package SKT Strong
  8. *
  9. * @since SKT Strong 1.0
  10. */
  11. global $complete;?>
  12.  
  13. <?php get_header();?>
  14. <div class="page_wrap layer_wrapper">
  15.   <!--CUSTOM PAGE HEADER STARTS-->
  16.   <?php get_template_part('sktframe/core','pageheader'); ?>
  17.   <!--CUSTOM PAGE HEADER ENDS-->
  18.  
  19.   <div id="content">
  20.     <div class="center">
  21.       <div class="single_wrap no_sidebar">
  22.         <div class="single_post">
  23.           <?php if(have_posts()): ?><?php while(have_posts()): ?><?php the_post(); ?>
  24.  
  25.             <!--EDIT BUTTON START-->
  26.             <?php if ( is_user_logged_in() || is_admin() ) { ?>
  27.               <div class="edit_wrap">
  28.                 <a href="<?php echo get_edit_post_link(); ?>">
  29.                   <?php _e('Edit','strong'); ?>
  30.                 </a>
  31.               </div>
  32.               <?php } ?>
  33.               <!--EDIT BUTTON END-->
  34.               <h1><?php the_title(); ?></h1>
  35.               <div class="woocommerce">
  36.                 <ul class="products">
  37.                   <?php
  38.  
  39.                   $paged = ( get_query_var('page') ) ? get_query_var('page') : 1;
  40.                   $args = array(
  41.                     'post_type' => 'product',
  42.                     'posts_per_page' => 12,
  43.                     'paged' => $paged,
  44.  
  45.                   );
  46.                   $loop  = new WP_Query( $args );
  47.                   if ( $loop->have_posts() ) {
  48.                     while ( $loop->have_posts() ) : $loop->the_post();
  49.                     wc_get_template_part( 'content', 'product' );
  50.                   endwhile;
  51.                 } else {
  52.                   echo __( 'No products found' );
  53.                 }
  54.                 wp_reset_postdata();
  55.                 ?>
  56.               </ul>
  57.  
  58.               <!-- <?php //  _e(__FILE__, 'strong') ?> -->
  59.               <?php
  60.               $the_query  = new WP_Query( $args );
  61.               if ($the_query->max_num_pages > 1) { // check if the max number of pages is greater than 1  ?>
  62.                 <nav class="woocommerce-pagination">
  63.                   <ul class="page-numbers">
  64.                     <li> <?php echo get_previous_posts_link( 'Anterior' ); // display newer posts link ?> </li>
  65.                     <li> <?php echo get_next_posts_link( 'Siguiente', $the_query->max_num_pages ); // display older posts link ?> </li>
  66.                   </ul>
  67.                 </nav>
  68.                 <?php } ?>
  69.  
  70.               </div>
  71.  
  72.             <?php endwhile ?>
  73.           </div>
  74.  
  75.  
  76.         <?php endif ?>
  77.       </div>
  78.       <!--PAGE END-->
  79.     </div>
  80.   </div>
  81. </div><!--layer_wrapper class END-->
  82. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement