I am trying to display some fields on the category product list page and the woocommerce_after_shop_loop_item_title hook. My information comes out perfectly, except it causes EACH product to display ALL the prices of the products on that page. If I remove my hook it works right again. I added this:
add_action( woocommerce_after_shop_loop_item_title , paradigm_custom_category_display , 5 );
function paradigm_custom_category_display() {
global $product;
if ( $product->get_short_description()) {
?>
<h2 class="woocommerce-loop-product__title pp-shortdescription">
<?php echo apply_filters( woocommerce_short_description , $product->get_short_description() ) ?>
</h2>
<?php
}
?>
<div class="pp-block">
<?php
if(get_field( author_name )) {
?>
<div class="pp-author"><span>Author: </span><a href="<?php the_field( author_link ); ?>" class="fancybox-iframe"><?php the_field( author_name ); ?></a></div>
<?php
}
if(get_field( pages )) {
?>
<div class="pp-pages"><span>Pages: </span><?php the_field( pages ); ?></div>
<?php
}
if(get_field( size )) {
?>
<div class="pp-size"><span>Size: </span><?php the_field( size ); ?></div>
<?php
}
if(get_field( isbn )) {
?>
<div class="pp-isbn"><span>ISBN: </span><?php the_field( isbn ); ?></div>
<?php
}
if(get_field( binding )) {
?>
<div class="pp-binding"><span>Binding: </span><?php the_field( binding ); ?></div>
<?php
}
?>
</div>
<?php
}
And that works for my new category information display. BUT EACH product shown also shows the price of ALL the products on the page now:
I removed each block of my function and that made no difference. The only way the price goes back to the correct display is not putting in the hook at all. I am new to this and lost. Can anyone help? Thanks.