Viewing 7 replies - 1 through 7 (of 7 total)
  • Was looking for the same thing so here it goes:

    1) Register the subtitle functionality for WC-products

    /**
     * Add subtitle field to WooCommerce products
     */
    function my_wp_subtitle_page_part_support() {
        add_post_type_support( 'product', 'wps_subtitle' );
    }
    add_action( 'init', 'my_wp_subtitle_page_part_support' );

    2) Add the corresponding template tag in your theme file

    <?php the_subtitle( '<h2 class="product-subtitle">', '</h2>' ); ?>

    This is of course my implementation, you should tweak it acordingly.
    Cheers,

    Henning

    What do you mean by 1) Register the subtitle functionality for WC-products

    I’d love to get this working too for woocommerce.

    You need to add that code to your theme’s functions.php to get it working.

    Hi. Brand new at this and could really use some help!

    Trying to implement wp_subtitle in the product pages – for selling books – I need a subtitle to include the author.

    Using child theme, Put #1 code above in functions.php – now subtitle field appears in backend, but can’t figure out where to place code to have it show up in product list pages, and individual product pages.

    Can someone please tell me which files I need to edit and where to paste — as specific as possible. Been driving me crazy- still have a lot to learn.

    Have a feeling it’s archive-product and single-product files…
    Thanks!

    webflex

    (@webflex)

    Hi, thanks for the Code!
    The first code works fine. I see the subtitle form at the backend.
    BUT where I have to put the second code into?

    I still don’t see the subtitle at frontend.

    Thanks!

    leanderbraunschweig

    (@leanderbraunschweig)

    You guys need to edit your theme files accordingly… Whereever you want the subtitle to appear really.

    Makes most sense to me to include it into CHILD-THEME/woocommerce/content-single-product.php or – even better – hook into woocommerce_single_product_summary with a lower priority than the woocommerce_template_single_title (5).

    Sorry, everything else is custom modification, work yourselves into theme modifications or hire a programmer to do this for you.

    tallavic

    (@tallavic)

    I add the plugin and the code. And it works in “only-content.php” where I have my list products.
    But how can I add it to “content-single-product.php”?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Product Woocommerce’ is closed to new replies.