Unload templates; disable parent Template Parts using only “theme.json”

Does anyone have any suggestions on how to disable certain template parts in a child theme using theme.json in WordPress with Gutenberg? Using only theme.json this is not possible, and runs counter to the vision for full site editing. In the future it’s possible that not only the parent theme templates might be visible, but … Read more

post_row_actions filter from parent theme not executing in child theme

There has been a major misunderstanding of child themes. Parent and child themes are a WordPress feature, not a PHP feature, and include is a PHP directive, not a WordPress function. To make the distinction and reason clearer child themes don’t inherit a parents “files” they inherit the parents “templates”. So include “inc/duplicate-posts.php”; will always … Read more

How can I use AJAX in child theme template?

It has nothing to do with child themes, the problem is here: add_action(“wp_ajax_nopriv_x_before_process”, “x_before_process”); Notice the nopriv, this is for logged out users, but it’s likely you are logged in This needs adding: add_action(“wp_ajax_x_before_process”, “x_before_process”); Note that this would not have been an issue if it was built using a more modern AJAX API such … Read more

Child theme css not loading when declared in parent functions

Because you’re using a subfolder path that starts with a /. The official WP.org developer doc for add_editor_style has an example of how to add a stylesheet from a subfolder in the comments: /** * Registers an editor stylesheet in a sub-directory. */ function add_editor_styles_sub_dir() { add_editor_style( trailingslashit( get_template_directory_uri() ) . ‘css/editor-style.css’ ); } add_action( … Read more