Support

Account

Home Forums Front-end Issues Show ACF field in WooCommerce Archive Listing Reply To: Show ACF field in WooCommerce Archive Listing

  • WooCommerce has _a literal ton_ of hooks to use. If you open up the plugin folder ( plugins/woocommerce/templates ) you can open up those files and see just how many you can hook into.

    The one you’re looking for is in the content-single-product.php file:

    /**
     * Display value after single product titles
     *
     * @return void
     */
    function prefix_after_title() {
    	echo get_field( 'after_title' );
    }
    add_action( 'woocommerce_single_product_summary', 'prefix_after_title', 6 );

    We need the priority of 6 because the file linked above shows that the title is prioritized at 5. If we wanted to display this before the title we would need to change the priority to something before 5.