Advertisement
Guest User

content-product

a guest
Aug 15th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 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. <li <?php post_class( $classes ); ?>>
  39. <div class="inbox">
  40.  
  41. <?php do_action( 'woocommerce_before_shop_loop_item' ); ?>
  42.  
  43. <div class="image-link">
  44. <?php
  45. /**
  46. * woocommerce_before_shop_loop_item_title hook
  47. *
  48. * @hooked woocommerce_show_product_loop_sale_flash - 10
  49. * @hooked woocommerce_template_loop_product_thumbnail - 10
  50. */
  51. do_action( 'woocommerce_before_shop_loop_item_title' );
  52. ?>
  53. <a href="<?php the_permalink(); ?>"><?php woocommerce_template_loop_product_thumbnail(); ?></a>
  54. <div class="overlay-image"></div>
  55. <div class="overlay-title">
  56. <?php woocommerce_template_loop_add_to_cart(); ?>
  57. </div>
  58. </div>
  59.  
  60. <a class="caption" href="<?php the_permalink(); ?>">
  61. <h4 class="product-title"><?php the_title(); ?></h4>
  62.  
  63. <?php
  64. /**
  65. * woocommerce_after_shop_loop_item_title hook
  66. *
  67. * @hooked woocommerce_template_loop_rating - 5
  68. * @hooked woocommerce_template_loop_price - 10
  69. */
  70. do_action( 'woocommerce_after_shop_loop_item_title' );
  71. ?>
  72.  
  73. <?php do_action( 'woocommerce_after_shop_loop_item' ); ?>
  74.  
  75. </a>
  76.  
  77. </div>
  78. </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement