After the update to V6 the 'get_footer' hook is not called anymore!

I just updated a pro website to version 6.0.1.

Without changing anything else the add_action ‘get_footer’ hook in the function.php in the child theme is not called anymore!

How can that be?

I’m not sure without seeing your child theme. I’ve confirmed the action is running even if you are using a custom footer. We do not set any actions for get_footer. Is your child theme running any code at all?

This specific page runs a lot of custom code.

But again. I have updated ONLY the pro theme to v6. No WordPress core update, no plugin updates, no changes to the code or changes in the Cornerstone settings.

And still the code below is not running. In the last version of pro V5 this worked without any problems!

add_action( 'get_footer', 'bhstein_enqueue_um_override', PHP_INT_MAX);
function bhstein_enqueue_um_override()
{
	
	$css_file_url 	= get_stylesheet_directory_uri() . '/css/um-members-override.css';
	$css_file_path = get_stylesheet_directory() . '/css/um-members-override.css';

	wp_enqueue_style('um-members-override', $css_file_url, array(), filemtime($css_file_path), 'all');
	
}

And the hook is also registered in $GLOBALS[‘wp_filter’] right after the add_action. Nevertheless, the function with the CSS enqueue is not executed.

Hi @Regnalf,

I have checked the code in my local environment, and it worked. And screenshot shows the console error for not getting the um-members-override.css file in the specific path while trying to enqueue the file.

There might be something else blocking the code to run at your end, I would like to suggest troubleshooting the following common issue to help us to recognize the reason.

  1. Theme Related Issue
  2. Plugin Conflict
  3. Theme Update related issue
  4. Child Theme Related issue ** if you have activated it.
  5. CSS/JS Customization
  6. Disabling Cache
  7. Disabling CDN

If you discover that an issue is coming from a custom code or 3rd party plugin, kindly consult with a developer or contact the plugin author. Please note that we do not provide support for custom codes and 3rd party plugins.
If none of the above help, please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

I’ve tried some issue tracking. All that i can say is that the wordpress function get_footer() is not being called at all! So the action hooks get_footer couldn’t fire either!
(the test_dump function is from me, and it works 100%)

I’ve provide Login Credentials, so you can see yourself.

Hi @Regnalf,

I have checked it thoroughly and it does not seem the problem with Pro. To make sure that the problem only persists with the Pro, I would request you to check by activating any of the default themes. If the issue persists, it might be some issue with custom coding which is beyond the scope of Theme Support.

Thanks

I have temporarily reset to the parent theme pro to version 5.1.5.
And without any other changes the hook works with v5!!!

It’s definitely the v6 version that’s causing problems!

Hello @Regnalf,

I am another staff checking in and I tested your code in my local testing server with the latest Pro theme version. It is working as expected and I did not encounter any issues. The code is reflected on the page source as well. I am using the following:

  • WordPress 6.1.1
  • Pro Theme 6.0.2
  • PHP 7.4.21

Please make sure that every thing is up to date. We highly recommend that you do the testing in a staging site to prevent your live site from crashing and do the troubleshooting in the staging URL only.

Best Regards.

I’ve created a staging site, (see updated secure note).

I tested the function in a new WordPress installation with Version 6. Yes there it works. But the site i have the issue uses a lot cornerstone layouts.

What i know so far.

  • Everything works fine in Version 5.1.5
  • Version 6.0.2 doesn’t fire the WordPress get_footer() function (which should fire the hook)

Please, take a closer look. It’s definitiv the v6 Version!

Hey @Regnalf,

I’ve checked your staging area and the issue is unique to your installation. We tested the function get_footer() and it is working correctly with our local environment. That being said, we don’t think that it is Pro issue. Since your website is well customized, there could be a conflict with the other code. Please note that troubleshooting custom coding is outside the scope of our theme support.

Thank you.

Sorry, i didn’t have much time recently to answer quickly.

I have now edited the development page so that no more plugins are active and no more custom code is executed. Apart from the get_footer hock. (See pro-child folder)

In the theme folder you can easily switch between version 515 and v6 (in the picture v6 is currently active).

Bildschirmfoto 2023-01-03 um 20.00.39

And again, only in version 515 the get_hook is executed and not in v6. Now it can only be the version v6.

v 5.1.5
Bildschirmfoto 2023-01-03 um 20.08.33

v6
Nothing

Hey @Regnalf,

I understand and see that get_footer doesn’t work on your site when using Pro 6.0.2. But, may we ask why you require get_footer?

If you only need to add a stylesheet to load in the footer, can’t wp_footer hook be used instead? wp_footer is the standard hook to add custom code in the footer and I tested that in your site and it works. It adds the stylesheet in the footer.

image

image

Thanks.

Thank you @christian for looking at it again.

All I want to achieve is that I can override the CSS settings of the Ultimate Members plugin with my own. Because this plugin unfortunately very often uses the !import functionality! Therefore, the CSS should be implemented as late as possible in the footer.

I have meanwhile used your x_after_colophon_end hook. Currently it works because the overwriting CSS is just behind that from Ultimate Member.

Bildschirmfoto 2023-01-09 um 07.59.08
If you know a hook that will be executed later i would be happy if you tell me.

I just wanted to understand in general why get_footer is not called anymore. I suspect it has to do with the complex layout structure of this site. Because as I and you wrote before, the get_footer is executed on a fresh new WordPress/Pro installation.

Thanks in advance

@Regnalf

Glad to hear that, @Regnalf. Why get_footer is not working on your site is still a mystery to us. Also, get_footer, according to the WordPress doc, is not the best hook to use as its original purpose is to get the footer of the theme and not to add code in the footer.

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