Home Forums WoodMart support forum Changing header on blog category pages, not just individual posts

Changing header on blog category pages, not just individual posts

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #258392

    mfj1
    Participant

    Hi,

    I can change the header menu on blog posts in the Woodmart settings, but it doesn’t change the menu in the archive page that the posts are in. I need the whole section to have a different header. How do I do that please. If it’s a coding job, please point me in the right direction, I can code, I just don’t have the time to search through your code for an answer.

    Thanks

    #258413

    mfj1
    Participant

    I’ve fixed it. Just need to use this filter. This checks if the page is a category and if so, changes the header to the one I want. Obviously adapt to your needs if anyone uses it.

    add_filter("woodmart_get_current_header_id","mf_woodmart_get_current_header_id",10,1);
    
    function mf_woodmart_get_current_header_id($id)
    {
    	if(is_category())
    		return "header_431855";
    	else 
    		return $id;
    }
    #258475

    Hello,

    Thank you for sharing your code. If you have any questions please feel free to contact us.

    Best Regards

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