[Resolved] Header Element for Woocommerce Categories

Home Forums Support [Resolved] Header Element for Woocommerce Categories

Home Forums Support Header Element for Woocommerce Categories

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1013200
    Kim

    Hi there,

    I would like to add custom header elements to each woocommerce category showing the category title and the woocommerce breadcrumbs (and remove them from the container section). Is this possible and can you help me with the necessary code?

    Many thanks in advance!

    BR Kim

    #1013823
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    The category title should display by default if you use the {{post_title}} template tag in the Header Element – can you confirm?

    For the breadcrumbs, we’ll have to create a shortcode:

    add_shortcode( 'custom_woo_breadcrumbs', function() {
        ob_start();
    
        woocommerce_breadcrumb();
    
        return ob_get_clean();
    } );

    Now you can add [custom_woo_breadcrumbs] to your Header Element.

    Let me know πŸ™‚

    #1013833
    Leo
    Staff
    Customer Support

    I’ve actually tested the template tag {{post_title}} and it works to display the category name πŸ™‚

    #1066017
    Kim

    Many thanks! Works all perfectly!

    #1066618
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.