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
- what is correct way to hook when update post
- Override get_template_directory() in child theme?
- Childs PHP files not overwriting Parent’s PHP files
- Enforcing password complexity
- Does an activated plugin automatically mean its methods are available to other WP functions?
- why is translation not working on theme?
- 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
- How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?
- How do I remove a require_once admin panel from the parent theme from the child theme functions.php?
- is there a simple way to list every templates / php files used to generate a specific page?
- Action ‘save_post’ not working for quick edit
- Can i check if user is doing any ajax request?
- add_meta_boxes action with refresh on save
- WordPress Child Themes
- Custom Background by Page IDs
- Error call_user_func_array() expects parameter 1 to be a valid callback when using image_size_names_choose
- jQuery code not working when included in functions.php
- add_action taking an array with the 2nd argument?
- Copyright info change – Corporate Plus Theme PHP [closed]
- Should `wp_login` be used since it’s deprecated?
- How to show a users bio on a page
- Override a function defined in wp-includes/comment-template.php
- Nested “do” and “add” Actions is possible?
- Started getting warning message following host’s PHP upgrade
- Change order of custom submenu link in WP Admin?
- How to catch wordpress post ID when it’s published
- WordPress redirect redirecting too many times or not at all
- Why does the Woocommerce grouped template prints the unpublished products?
- 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?
- Use custom template on custom post type
- How to have different site identity logos on each page on Astra Theme [closed]
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- How to pass argument to add_action while the method is inside a class?
- Display attribute on shop page after the title
- Include style.css in the Child Theme with PHP
- 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
- Creating a child theme after numerous edits to parent theme
- Dynamically adding filters
- using wp enqueue style to create a CSS file specifically for a page template
- Woocommerce custom Plugin in wordpress [closed]
- How to style injected code in header section?
- Where should I copy a PHP file from wp-includes to, in order to override it in my child theme?
- Child Theme’s Read More Text
- Need advice on theme customizer and child themes
- How to pass hook variable to function?
- Conditionally remove comments and post meta in functions.php
- Trying to change featured image from 180×180 to full width on home page
- How to edit background color of only one sidebar?
- Inline CSS header style priority function.php Child (no enqueing I think)
- Change image data durgin upload
- WordPress Post Block Element not properly parsed with the_content filter
- Why would the child theme load in the Customize preview, but not on the site itself?
- Remove an action created by a Gravity Forms add-on
- Proper way to remove html code on child theme
- Child-Theme Category View with modified permalinks (%category% removed)
- File from parent theme imported to child theme doesn’t work – any ideas?
- Use PHP Class in WordPress functions
- WordPress How do I pass a variable from one add_action to another?
- 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
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- I want to hide “sold by” on certain pages with id page 43
- Get original value in save_post action hooka
- AJAX numerical pagination problem in TwentyFifteen-child theme
- How to change the structure/order of sections in a WordPress theme? [closed]
- How to edit button permalink inside function.php using a child theme?
- How to locate parent theme functions and add functions to my wordpress 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?
- Modifying child theme’s header
- How to Change Site Elements based on referring URL
- How do I remove an action hook inside a class that is called by another class?
- add_action in wp_head accessible from class
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- Add the shortcodes from the enfold theme to the other theme
- 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?
- WordPress child theme, creating a custom php template page
- in the post admin, is it possible to make the post title input disabled using php?
- Hook into all password resets in WordPress and get password before hashing?
- Why should I need to add init action to include PHP file to WordPress Plugin?
- How to override html codes in wordpress?
- random woocommerce categories are not showing when count enabled?
- remove_action() not working in page template – Genesis
- Unable to pass arguments to function used in add_action
- Add Text Area To Child Theme’s Home Page