Advertisement
Guest User

Untitled

a guest
May 27th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template name: Out of stock
  4. *
  5. *
  6. * @package WooFramework
  7. * @subpackage Template
  8. */
  9.  
  10. get_header();
  11. ?>
  12.  
  13. <!-- #content Starts -->
  14. <?php woo_content_before(); ?>
  15. <div id="content" class="col-full">
  16.  
  17. <div id="main-sidebar-container">
  18.  
  19. <!-- #main Starts -->
  20. <?php woo_main_before(); ?>
  21. <section id="main">
  22.  
  23.  
  24. <ul class="products">
  25. <?php
  26.  
  27. $args = array(
  28. 'key' => '_stock_status',
  29. 'value' => 'outofstock',
  30. 'compare' => '='
  31. );
  32.  
  33. $the_query = new WP_Query( $args ); ?>
  34.  
  35. <?php if ( $the_query->have_posts() ) : ?>
  36.  
  37. <!-- pagination here -->
  38.  
  39. <!-- the loop -->
  40. <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  41. <li <?php post_class( $classes ); ?>>
  42.  
  43. <?php do_action( 'woocommerce_before_shop_loop_item' ); ?>
  44.  
  45. <a href="<?php the_permalink(); ?>">
  46.  
  47. <?php
  48. /**
  49. * woocommerce_before_shop_loop_item_title hook
  50. *
  51. * @hooked woocommerce_show_product_loop_sale_flash - 10
  52. * @hooked woocommerce_template_loop_product_thumbnail - 10
  53. */
  54. do_action( 'woocommerce_before_shop_loop_item_title' );
  55. ?>
  56.  
  57. <h3><?php the_title(); ?></h3>
  58.  
  59. <?php
  60. /**
  61. * woocommerce_after_shop_loop_item_title hook
  62. *
  63. * @hooked woocommerce_template_loop_rating - 5
  64. * @hooked woocommerce_template_loop_price - 10
  65. */
  66. do_action( 'woocommerce_after_shop_loop_item_title' );
  67. ?>
  68.  
  69. </a>
  70.  
  71. <?php
  72.  
  73. /**
  74. * woocommerce_after_shop_loop_item hook
  75. *
  76. * @hooked woocommerce_template_loop_add_to_cart - 10
  77. */
  78. do_action( 'woocommerce_after_shop_loop_item' );
  79.  
  80. ?>
  81.  
  82. </li>
  83. <?php endwhile; ?>
  84. <!-- end of the loop -->
  85.  
  86. <!-- pagination here -->
  87.  
  88. <?php wp_reset_postdata(); ?>
  89.  
  90. <?php else : ?>
  91. <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
  92. <?php endif; ?>
  93.  
  94. </ul>
  95.  
  96.  
  97. <?php
  98. woo_loop_before();
  99.  
  100. if (have_posts()) { $count = 0;
  101. while (have_posts()) { the_post(); $count++;
  102. woo_get_template_part( 'content', 'page' ); // Get the page content template file, contextually.
  103. }
  104. }
  105.  
  106. woo_loop_after();
  107. ?>
  108. </section><!-- /#main -->
  109. <?php woo_main_after(); ?>
  110.  
  111. <?php get_sidebar(); ?>
  112.  
  113. </div><!-- /#main-sidebar-container -->
  114.  
  115. <?php get_sidebar( 'alt' ); ?>
  116.  
  117. </div><!-- /#content -->
  118. <?php woo_content_after(); ?>
  119.  
  120. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement