![]() ![]() I did a grep -rli "wp_enqueue_style" * search in the flatsome theme, list is at the bottom. What specifically do I replace them with, respectively? I’ve been trying combinations, but I fundamentally don’t understand what the placeholders need to be replaced with. Wp_get_theme()->get('Version') // this only works if you have Version in the style headerĭo I replace both ‘child-style’ and ‘parenthandle’, as well as anything else? Wp_enqueue_style( 'child-style', get_stylesheet_uri(), I think you need to be more clear in exactly what needs to be replaced in this bit of code: add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ) Which part of that ^^ do I need to add to the page? This is important for styles because order matters, and WP loads the child theme first, but the child styles should be after the parent styles. 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 3 years 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |