1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Divi shop loop subtitle

Discussion in 'Free Divi Community Forum' started by Hannah89, Dec 1, 2021.

  1. Hannah89

    Hannah89 New Member

    I am using Divi with Woocommerce for a bookshop and would like to add the name of the author as a subtitle for each book product in the Divi Shop module. However, I cannot seem to get the PHP code right (new to it). What am I doing wrong?

    Code:

    function woocommerce_shop_loop_item_subtitle() {
    global $product;
    echo '<p class="add_author_name">' . get_the_terms($product->ID, 'product_cat', true) . '</p>';
    }
    add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_shop_loop_item_subtitle', 10 );
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade mega menu design for your Divi site without using any plugins:View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member