Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.13 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', 4 );
  23.  
  24. // Ensure visibility
  25. if ( ! $product || ! $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
  40.        
  41.     $product_cats = wp_get_post_terms( get_the_ID(), 'product_cat' );
  42.     $single_cat = array_shift( $product_cats );
  43.  
  44.  
  45.    
  46. ?>
  47.  
  48. <li <?php post_class( $classes ); ?> data-categoria="<?php //HERE PARENT ?>">
  49.  
  50.     <?php do_action( 'woocommerce_before_shop_loop_item' ); ?>
  51.  
  52.     <a href="<?php the_permalink(); ?>">
  53.         <div class="img-prods">
  54.  
  55.             <?php
  56.                 /**
  57.                  * woocommerce_before_shop_loop_item_title hook
  58.                  *
  59.                  * @hooked woocommerce_show_product_loop_sale_flash - 10
  60.                  * @hooked woocommerce_template_loop_product_thumbnail - 10
  61.                  */
  62.                 do_action( 'woocommerce_before_shop_loop_item_title' );
  63.             ?>
  64.  
  65.             </div>
  66.  
  67.  
  68.             <div class="<?php //HERE PARENT ?>"></div>
  69.             <h3 class="title-cofre"><?php the_title(); ?></h3>
  70.  
  71.            
  72.             <?php
  73.                 /**
  74.                  * woocommerce_after_shop_loop_item_title hook
  75.                  *
  76.                  * @hooked woocommerce_template_loop_rating - 5
  77.                  * @hooked woocommerce_template_loop_price - 10
  78.                  */
  79.                 do_action( 'woocommerce_after_shop_loop_item_title' );
  80.             ?>
  81.        
  82.     </a>
  83.  
  84.    
  85.     <?php do_action( 'woocommerce_after_shop_loop_item' ); ?>
  86.  
  87. </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement