• Hi all,

    I have the following snippet for changing certain category titles, but its not working in ocean theme, Im guessing its not using the correct hook? Can anyone advise help?

    add_filter( 'woocommerce_page_title', 'customize_woocommerce_page_title', 10, 1 );
    function customize_woocommerce_page_title( $page_title) {
    
        // Custom title for the product category 't-shirts'
        if ( is_product_category('t-shirts') ) {
            $page_title = 'Something';
        }
        // Custom title for the product category 'hoodies'
        elseif ( is_product_category('hoodies') ) {
            $page_title = 'Something else';
        }
        return $page_title;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Shahin

    (@skalanter)

    Hello @dspink,

    Unfortunately, this is not possible to change the heading with the hook, but this is forwarded to the developer team, and it will be added/improved for the next updates.

    For an alternative solution, you can use the subheading on OceanWP theme:

    // Custom Page Subheading
    function custom_subheading_title( $subheading ) {
     
        // Custom title for the product category 'hoodies'
        if ( is_product_category('hoodies') ) {
            $subheading = 'Something else';
        }
    	
    	echo '<h2>'.$subheading.'</h2>';
        
    }
    add_filter( 'ocean_post_subheading', 'custom_subheading_title' );

    screenshot

    Best Regards

    Thread Starter dspink

    (@dspink)

    @skalanter

    Thanks for this, can make that work for now.

    Shahin

    (@skalanter)

    You are welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Woocommerce category title’ is closed to new replies.