Home Forums WoodMart support forum change header on specific page

change header on specific page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #581916

    mounir.madjour
    Participant

    Hey
    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.
    #581952

    mounir.madjour
    Participant

    How 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

    #582046

    Hung Pham
    Keymaster

    Hi 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,

    #582158

    mounir.madjour
    Participant

    yes 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

    #582262

    Hung Pham
    Keymaster

    Hi 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,

    #582475

    mounir.madjour
    Participant

    I 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.

    #582499

    mounir.madjour
    Participant

    Solution 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 priority

    #582629

    Hung Pham
    Keymaster

    Hi mounir.madjour,

    Thanks for sharing solution.

    Please let me know if you resolved the issue.

    Regards,

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