The child theme’s functions.php
is loaded before the parent theme’s functions.php
:
Unlike templates and patterns, the functions.php file of a child theme does not override the functions.php file in the parent theme. In fact, they are both loaded, with the child being loaded immediately before the parent.
Source:
https://developer.wordpress.org/themes/advanced-topics/child-themes/#using-functions-php
This means that when the child theme’s remove_action()
is called, there is no action to remove. To circumvent this, try this in the child theme’s functions.php
(untested):
add_action( 'wp_footer', static function () {
remove_action( 'wp_footer', 'blankslate_footer', 10 );
}, 9 );
This should work, because it hooks into the same action with an earlier priority, and removes the hook (if it exists).
Related Posts:
- remove_action from parent theme using child theme functions.php
- Childs PHP files not overwriting Parent’s PHP files
- Enforcing password complexity
- How to set custom cookies before output
- Is it possible to disable a function of a parent theme?
- How to override an unpluggable parent theme function?
- Check php version before theme activation
- Getting the action’s tag name within the action
- Action ‘save_post’ not working for quick edit
- Can i check if user is doing any ajax request?
- Copyright info change in Theme Child PHP
- Add footer.php to WordPress child theme
- Use wc_enqueue_js only on specific pages – nested add_action
- Setting up the child theme so as to enable right-to-left WordPress?
- Insert post without actions/hooks
- Understanding WordPress child theme custom JS loading
- Hooking new functions to actions + passing parameters
- Find variables available at a given hook
- Understanding child theme functions.php
- How to stop PHP code running when in a child theme
- save_post vs post_updated
- Want to create Child theme, but already edited Parent theme css files and some php files
- How to access function from outside of a class within this class in WP plugin?
- Extend a class of a plugin
- action hook wp_head higher priority as all other plugins/hooks
- How to add custom post meta to default blog post?
- WordPress child theme fails to override parent navigation menu in /inc/structure/header.php
- action is not called after a php request
- Remove an action hook within a Class
- How to pass arguments to add_action() or retrieve return value of called function?
- Is it acceptable to treat a filter like an action?
- Ajax – Call to undefined function get_option()
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Removing an action from wp_footer called in a class that’s inside a bigger class
- action theme mailchimp subscriber fields
- How to edit php files in Child Theme?
- WordPress Child Themes
- How to show a users bio on a page
- Override a function defined in wp-includes/comment-template.php
- Started getting warning message following host’s PHP upgrade
- How to catch wordpress post ID when it’s published
- How to edit HTML of my website on WordPress? [closed]
- Divi change project category slug
- How to specify the path for require_once in a child theme?
- Warning: printf(): Too few arguments in helpers.php file
- What’s a good way to allow overwriting files within a child theme if I want the same folder structure?
- WordPress filter load_textdomain_mofile not working inside a child theme’s functions.php but works form inside a plugin
- How do I check or test a WordPress Auto Year Change Script?
- How to have different site identity logos on each page on Astra Theme [closed]
- How to pass argument to add_action while the method is inside a class?
- Action Hook Inside WordPress Plugin Shortcode
- Problems clearing cache
- Removing “Powered by” footer using child theme PHP [closed]
- Overide Variable in Child Theme
- child parent styles enqueue order
- Dynamically adding filters
- using wp enqueue style to create a CSS file specifically for a page template
- How to style injected code in header section?
- Need advice on theme customizer and child themes
- How to pass hook variable to function?
- Inline CSS header style priority function.php Child (no enqueing I think)
- Change image data durgin upload
- Why would the child theme load in the Customize preview, but not on the site itself?
- Child-Theme Category View with modified permalinks (%category% removed)
- Use PHP Class in WordPress functions
- How to change this ajax function to submit to the default wordpress content area instead of the custom field ‘seller notes’?
- Child theme overirde template-tags in a theme built on underscores in inc/template-tags
- I want to hide “sold by” on certain pages with id page 43
- Get original value in save_post action hooka
- How to edit button permalink inside function.php using a child theme?
- How to let mobile navigation menu close when link is clicked?
- how to add functions to my function.php using a child theme?
- How to Change Site Elements based on referring URL
- add_action in wp_head accessible from class
- If i use a child theme to add new code blocks to header.php, how does it get inserted in the right place in parent’s header.php?
- in the post admin, is it possible to make the post title input disabled using php?
- How to override html codes in wordpress?
- wordpress form action page not found
- Adding custom PHP to existing loop in Genesis
- Where to find the html for WordPress site? [closed]
- Child theme functions.php file change database entries
- How to remove image on single product and get product to span page?
- Modify arguments for parent theme’s `wp_register_style` via child theme
- Child theme not working properly
- How does add_action ‘comment_post’ work?
- Custom action on comment post
- If I define a variable in header.php, how do I make it available to templates?
- Cannot modify header information – headers already sent
- Fix incorrect related posts code snippet
- Child-theme suddenly stopped working [closed]
- Divi – add title to mobile menu button
- Why a class property becomes empty?
- How to change wp-admin and wp-login urls
- How can I use AJAX in child theme template?
- Is there a hook that I can use when a fatal error occurs?
- Execute wp_after_insert_post after the permalink is customized
- Too few arguments – wp_login action
- Live Preview while customizing is not showing the updates while editing in WordPress
- Disable RSS /feed/ endpoints on posts without disabling RSS overall
- Can’t make an external api call in php side of wordpress child theme