This is because it depends on that one being loaded first, and if it’s not found, then it’s not loaded. If it uses a different handle, you get two copies of the same thing.Īnd in the dependency parameter (the third parameter in wp_enqueue_style), it needs to be a match or it won’t be loaded at all. If the child theme uses the same handle (in the first parameter), then since it is loaded first, its parameters “win”. I think they got the name “handle” from radio operator jargon it’s like a nickname, so WP can identify each style and each script uniquely. The example code is just an example, since every theme is different. If you look in your parent theme, where it calls wp_enqueue_style, you will see what it uses for the first parameter, which is the handle, which your child theme needs to match so that it works correctly. This topic was modified 2 years, 11 months ago by Tomi. So in-case I wasn’t clear, I want to know which I should use for my flatsome child theme, or a combination thereof. – get_stylesheet_uri() instead of get_template_directory_uri().’/style.css’ – ‘child-style’ instead of ‘parent-style’ Here is my style.css code in my child theme: /*ĮDIT: So I’ve included the differences which I don’t understand: developer.wordpress get('Version') // this only works if you have Version in the style header I see a lot of similarities but a lot of differences. The functions.php code is different from the 2 sources, and I would really appreciate some guidance. With respect to the developer wordpress post, I am on step 3. I had both instructions up side by side to make sure I understand. The first being from these forums, another from my domain and host provider, hostinger: I have found 2 separate sources for this, with seemingly different code instructions. I am in the process of making a child theme for my Theme, flatsome.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |