Header and Footer not showing in specific page

Hi,

I am using Pro with WCFM and at the Vendor Page the Header and Footer is not showing up.
Can you please assist with this?

Thanks in advance!

Hi @Hugobosss,

Thank you for reaching out to us. Try this, first setup a child theme:

After that add the following code in your child theme’s functions.php file:

add_filter('cs_match_header_assignment', 'custom_header');
function custom_header($match) {
	if (is_woocommerce()) {
		$match = 1234; // the post ID for your header
	}
	return $match;
}

That 1234 is the post ID you need for this snippet. You need to get the post ID of the header you’d like to assign. The easy way to do that is to simply hover over the Edit link in the builder, and take a look at the URL in your status bar. It should look similar to domain.com/x/#/headers/1234

Hope this helps!

Hi,

Thanks for your reply!
Unfortunately the code didn’t do anything. I added it to functions.php and changed 1234 to 9851.
Do you have any other idea please?

Thank you!

Hi @Hugobosss,

The code given works fine on our end, you can see more about that code here.

It looks like you did not enable your child theme. Please navigate to Appearance > Themes and make sure its the child theme is the one active.

Thanks,

Hi,

I used the Code Snippets Plugin to insert the code in the functions file.
Now I have done as advised and installed the Child theme and inserted the code in the functions.php file and I can’t see that it works. Can you please have a look?

Thank you!

Hey @Hugobosss,

In that case please get back to us with the URL/User/Pass of your WordPress dashboard using the Secure Note functionality of the post to follow up the case.

Thanks!

Hi,

Here are the details

Hi @Hugobosss,

I checked your site and it could be because of the custom post type which is the WCFM where the seller page which may not validate as is_woocommerce().

If there a chance that you can get in touch with the plugin developer and ask them how to check if the post/page open is a WCFM page/post? Then you can substitute our code with that.

Hope this helps.

Hi,

I asked the plugin developer and I got below response.

You have to check whether a page is vendor’s store page or not using this -
wcfm_is_store_page()

I changed your code to below but the header and footer is still not showing.

add_filter(‘cs_match_header_assignment’, ‘custom_header’);
function custom_header($match) {
if (wcfm_is_store_page()) {
$match = 9851; // the post ID for your header
}
return $match;
}

Hi @Hugobosss,

The filter cs_match_header_assignment is not being called on that page. And the reason is probably the templates your plugin use. Example, I checked that page and it uses a different template codes

And that filter will only activate where it’s called, in theme’s template. Would you mind providing your FTP login credentials as well?

Thanks!

Hi,

Thanks for checking this, I will provide the login details.

Hey @Hugobosss,

This could be a conflict between our theme and WCFM Marketplace.

I could say that because I’ve done the following tests:

  1. Assigned one of your headers as Global and the Global Header won’t show up on the vendor page.
  2. Switched the header to the Original/Classic Header and still no dice
  3. Switched to the parent theme and issue persists
  4. The vendor page shows the header of the default WordPress TwentyNineteen theme.

The Global Header or even the Classic/Original Header will need to be displayed first before using the cs_match_header_assignment filter as that’s just to override the header assignment.

Because this is a plugin conflict case, what we could do is post this in our issue tracker so this will be queued for investigation by our development team. They will be the ones to decide if they’re going to support the plugin.

Please keep the WP Admin and FTP access open for us or better yet, copy your site to a staging server and give us Staging WordPress Admin and Staging FTP access so there’s no risk of breaking your live site.

Thanks.

Hi,

Thanks for looking into this, it’s really bad news for me that this is not supported.
I had thought that this would not be a big issue and it’s now the main issue with my whole multivendor site. It will not work without header and footer.

I have created staging site: https://www.staging2.handgjortfabriken.se/
Please let me know if there is anything else you need.

How will I know the status of this?

Hi @Hugobosss,

We understand that this might be a big issue on your installation. As my colleague mentioned this is a conflict with a third party plugin and it is outside of our support scope. I checked and my colleague already added this to our issue tracker.

Such cases are checked by our developers regularly but there is no guarantee for a fix. At the moment, I suggest that you also contact the plugin developer and inform them about the case, they might have insight about their codebase that helps.

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.