Home › Forums › WoodMart support forum › change header on specific page
change header on specific page
- This topic has 7 replies, 2 voices, and was last updated 5 months ago by Hung Pham.
-
AuthorPosts
-
July 8, 2024 at 9:19 pm #581916
mounir.madjourParticipantHey
1 I have created a new header for the store page
2 I have selected the right header in page edit settings but the website keeps showing the default header
I also cleared the cache many times.Attachments:
You must be logged in to view attached files.July 9, 2024 at 7:05 am #581952
mounir.madjourParticipantHow do I get the header ID? I’m coding a snippet code to replace the header this is example
// Function to set a special header for store pages
add_filter(‘woodmart_get_current_header_id’, function ($id) {
// Check if the current page is a vendor store page
if (marketking()->is_vendor_store_page()) {
return ‘store_page_header’;
}
}
// Return the original header ID if not a vendor store page
return $id;
);// Add this to your theme’s functions.php file or a custom plugin
July 9, 2024 at 11:51 am #582046
Hung PhamKeymasterHi mounir.madjour,
Thanks for reaching to us.
The default header is
main default header
and you set it as Custom header to this page as well https://prnt.sc/c7pSbpQPX2d8 so you can’t see any difference. Please change to other header.Regards,
July 9, 2024 at 3:35 pm #582158
mounir.madjourParticipantyes the default header is main default header and I used custom header for the page not the main header
kindly how I can find the header id is it the title
July 10, 2024 at 8:12 am #582262
Hung PhamKeymasterHi mounir.madjour,
Please double check, you set same default header for Custom header https://prnt.sc/mAu7wOCt8ZUd
In order to know the header’s ID, please take a look at address bar https://prnt.sc/CZHpuoJCYOIL
Regards,
July 10, 2024 at 5:14 pm #582475
mounir.madjourParticipantI checked the picture, and this page is for all stores. I’m working on an individual store page named store-page. When you check it, you will see the header I selected, and it works perfectly. The challenge is that I’m giving my vendors a URL like website.com/vendorname. The theme can’t detect if this page is a store-page and shows the default template.
Fortunately, the multivendor plugin provides a hook to detect if the page is a vendor page. I’m looking for a hook from your side to pass the header ID.
Thank you for the header ID information. Is there any documentation for theme hooks? I need a hook to pass the header ID based on the page type.
July 10, 2024 at 6:43 pm #582499
mounir.madjourParticipantSolution to this issue Marketking Plugin vendor stores using based URL
how to use special header snippets
add it to function.php child theme// vendor stores header
add_filter(‘woodmart_get_current_header_id’, function ($id) {
if (marketking()->is_vendor_store_page()) {
return ‘header_963785’; // Replace with your actual header ID
}
return $id;
}, 1); // Setting the priority to 1 for top priorityJuly 11, 2024 at 11:10 am #582629
Hung PhamKeymasterHi mounir.madjour,
Thanks for sharing solution.
Please let me know if you resolved the issue.
Regards,
-
AuthorPosts
- You must be logged in to create new topics. Login / Register