Home Forums WoodMart support forum How to set individual header for shop categories?

How to set individual header for shop categories?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #272224

    farfallina
    Participant

    Hi dear support,
    is it possible to set an individual header (made before in the header builder) for shop categories? I just find this possibility for pages and products, but not for shop categories.

    Thanks for help!

    #272236

    Hello,

    Thank you very much for choosing our theme and for contacting us.
    Try to add the following PHP code snippet to the child theme functions.php file to do this. Replace ids 10 and 11 with your categories ids and header_576762 with header ids.

    add_filter(
    	'woodmart_get_current_header_id',
    	function ( $id ) {
    		if ( is_product_category() && is_object( get_queried_object() ) ) {
    			if ( get_queried_object()->term_id == 10 ) {
    				return 'header_576762';
    			} elseif ( get_queried_object()->term_id == 11 ) {
    				return 'header_496420';
    			}
    		}
    		return $id;
    	}
    );

    Best Regards

    #272675

    farfallina
    Participant

    Thank you! That worked great!! 🙂

    #272729

    Most Welcome 🙂

    If you do not mind, can you please leave a 5 stars rating for our Theme & Customer and Technical Support by going here: http://themeforest.net/downloads It will allow us to release more updates and provide dedicated support in future. It would encourage our work a lot. If you like our Theme and Support.

    please, help us improve our theme and servicing by filling the following quiz
    https://8uehqcg4tjy.typeform.com/to/IgyV2EiP
    it won’t take more than 2 minutes of your time 🙂

    Thanks for contacting us.
    Have a great day 🙂

    Topic Closed.
    Best Regards.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘How to set individual header for shop categories?’ is closed to new replies.