Advertisement
Guest User

Untitled

a guest
Sep 20th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying product content within loops.
  4. *
  5. * Override this template by copying it to yourtheme/woocommerce/content-product.php
  6. *
  7. * @author WooThemes
  8. * @package WooCommerce/Templates
  9. * @version 1.6.4
  10. */
  11.  
  12. if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  13.  
  14. global $product, $woocommerce_loop;
  15.  
  16. // Store loop count we're currently on
  17. if ( empty( $woocommerce_loop['loop'] ) )
  18. $woocommerce_loop['loop'] = 0;
  19.  
  20. // Store column count for displaying the grid
  21. if ( empty( $woocommerce_loop['columns'] ) )
  22. $woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 2 );
  23.  
  24. // Ensure visibility
  25. if ( ! $product->is_visible() )
  26. return;
  27.  
  28. // Increase loop count
  29. $woocommerce_loop['loop']++;
  30.  
  31. // Extra post classes
  32. $classes = array();
  33. if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] )
  34. $classes[] = 'first';
  35. if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] )
  36. $classes[] = 'last';
  37. ?>
  38.  
  39. <?php echo do_shortcode('[featured_products per_page="12" columns="2"]'); ?>
  40.  
  41. <li <?php post_class( $classes ); ?>>
  42.  
  43. <?php do_action( 'woocommerce_before_shop_loop_item' ); ?>
  44.  
  45. <h1><a href="<?php the_permalink(); ?>"></h1>
  46.  
  47. <div id="prod-thumbnail">
  48.  
  49. <?php
  50. /**
  51. * woocommerce_before_shop_loop_item_title hook
  52. *
  53. * @hooked woocommerce_show_product_loop_sale_flash - 10
  54. * @hooked woocommerce_template_loop_product_thumbnail - 10
  55. */
  56. do_action( 'woocommerce_before_shop_loop_item_title' );
  57. ?>
  58.  
  59. </div><!--END PRODUCT THUMBNAIL-->
  60.  
  61. <div id="prod-info">
  62.  
  63. <h2><?php the_title(); ?></h2>
  64.  
  65. <?php
  66. /**
  67. * woocommerce_after_shop_loop_item_title hook
  68. *
  69. * @hooked woocommerce_template_loop_price - 10
  70. */
  71. do_action( 'woocommerce_after_shop_loop_item_title' );
  72. ?>
  73.  
  74. </a>
  75.  
  76. <?php do_action( 'woocommerce_after_shop_loop_item' ); ?>
  77.  
  78. </div><!--END PRODUCT INFORMATION-->
  79.  
  80. </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement