Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Child theming is a safe way to modify a theme. A child theme inherits a "parent themes" styles and then can selectively override. This alternative to "destructive" editing allows for safe updating of the parent theme and provides an easy way to undo theme changes.
20
votes
Accepted
Is it possible to make grandchild themes?
Sort of "Yes" as a technicality, in practice No.
You can specify a child parent as the parent theme, nothing stops this, and WordPress would attempt to use it.
However
You will run into major issues, …
7
votes
How to add code to Header.php in a child theme?
Adding a Code Snippet
HTML
If you want to add a code snippet e.g. a meta tag etc to the <head>, then you should use the wp_head action:
add_action( 'wp_head', 'wpse_43672_wp_head' );
function wpse_436 …
5
votes
get_stylesheet_directory() in child theme breaks parent scripts
The problem your facing here can be solved by changing the function being used:
get_stylesheet_directory will give you the directory of the current active theme, aka the location of the active style …
4
votes
How could child theme be different than parent theme if I haven't made changes?
This is possibly because you had a menu assigned, then you changed themes, and now there is no longer a menu assigned. Because Wordpress generates slightly different html for an assigned menu than for …
4
votes
how to call files in child theme?
All your included js and css files are included using relative paths. This is bad.
You'll find that the use of a child theme is irrelevant, as it is horribly broken with and without a child theme.
S …
4
votes
Accepted
CSS in child theme not getting loaded
Parent vs Child Themes
get_template_directory_uri always refers to the parent theme you can verify this as you always should when things don't load as expected by looking in the console in the browse …
4
votes
Accepted
How can I override file featured-image-first.php of Avada theme
Child themes let you override templates loaded via WordPress' template loading mechanism, e.g. get_template_part or the main theme templates such as index.php and single.php.
But they can't be used to …
4
votes
Accepted
Custom post types and child theme
You need to flush and regenerate your permalinks everytime you modify/add/remove custom post types or taxonomies.
Going to the permalinks page and saving should be enough
( Also your custom post typ …
3
votes
Should template files be copied to the child theme for editing?
You should only copy the files you intend to change, otherwise when the parent theme is updated, it will load the out of date files in the child theme that you didn't edit
Think of it this way, any t …
3
votes
Accepted
Child theme stylesheet not always overriding "index"
wp_enqueue_style( $parent_style, get_stylesheet_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp …
3
votes
Accepted
How can I override a require() used in functions.php of parent theme to my child theme
This is not possible, require is a PHP language construct, it's not a WordPress function, and can't be filtered or overriden via WordPress APIs
These are your options:
If the functionality you want …
3
votes
Is my child theme working properly
There's a simple way to test:
add wp_die('it works'); to functions.php, if you see it works on every page, then it's worked
add a silly CSS rule to style.css, e.g. body { border: 100px solid pink; } …
2
votes
filemtime(): stat failed warning within a child theme
There are 2 major problems here:
Problem 1: get_template__.... and get_stylehsheet_... are not the same
filemtime(get_template_directory() . '/dist/css/custom-style.css'), means get the file modified …
2
votes
Accepted
Should a child theme share the same theme options row as the parent, or should it have it's ...
Neither.
Theme options should be stored as theme mods, using get_theme_mod and set_theme_mod.
Internally these map on to options, but it is the official way to store theme specific options, that way …
2
votes
Accepted
Is there a way to override require_once of the main theme on the child theme?
No, the parent themes functions.php is always loaded, and require_once is not a WordPress API but a part of the PHP language itself
The only way to change it would be to modify the file