Tag Info

Hot answers tagged

8

You don't have to use @import. It's best not to, actually. Using an enqueued approach is probably better all around. Here's the relevant part of twentythirteen's code: function twentythirteen_scripts_styles() { ... // Loads our main stylesheet. wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' ); ... } ...


2

warning This solution doesn't respect the parent theme's dependencies! Changing the parent theme's handle name affects the chain of dependencies set in the parent theme. See my much simpler other answer. orignal answer Although Otto's answer is pretty good, I ended up with this in my child theme's functions.php function my_theme_styles() { global ...


1

The WP_DEFAULT_THEME constant actually just overrides what WordPress sets as default theme (which per default is the latest of the bundled themes). It does not really help you to define your parent theme. In fact you just have to "Network enable" your parent and child themes and then set the parent theme in the child themes header. No need to do more than ...


1

QUESTION 1 Is it safe to include the assumption that parent themes properly enqueue the child theme styles, from the standpoint of child theme standards? General rule of thumb, yes. But, you should never assume. Most disasters and failures in live are due to assumptions or facts based on an assumption FACTS WITHOUT ASSUMPTIONS A child theme's ...


1

Actually @Pieter Goosen took care of the issue when he corrected the Codex and removed the call to the extra style sheet. So in fact this works the way it should add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); } Thanks Pieter. ...


1

I would definitely avoid using 2 different wordpress themes and instead code for a more responsive website with CSS mediaqueries. It has worked out very well for me on the Wordpress websites I created. If you're not familiar with media queries, here's a very basic rundown. HTML -- <div class="box">hello world</div> CSS -- .box { ...


1

You simply need to run your code on a higher priority than what the parent theme is, the default on add_action function is 10 so you can use: function s157343_unregister_widgets() { unregister_widget( 'Chocolat_Widget_New_Entrys' ); } add_action( 'widgets_init', 's157343_unregister_widgets', 20 ); This will unregister that widget. Of course, you can ...



Only top voted, non community-wiki answers of a minimum length are eligible