How to change Parent Themes in Child Theme CSS

I think you are confused about this. Let me explain. The @import url(“../responsive/style.css”); is telling the Child theme to import the Responsive themes style.css. This is important because without this the Child theme doesn’t know what its Parent theme is. So the @import url(“../responsive/style.css”); points the Child theme to the default (main) file in the … Read more

Where is the correct place(s) in twentysixteen’s header.php to add a Google webfont?

You can place it in header.php between starting <head> and closing </head> tags and it should work properly. Or perhaps a better solution would be to enqueue the style in functions.php function google_fonts() { $query_args = array( ‘family’ => ‘Sigmar+One’ ); wp_register_style( ‘google_fonts’, add_query_arg( $query_args, “//fonts.googleapis.com/css” ), array(), null ); } add_action(‘wp_enqueue_scripts’, ‘google_fonts’);

Overriding a theme redux file in child theme

If you need to add the settings in parent theme created section, just place the below code in child functions.php But remember to replace OPT Name with your_opt_name in “OPT_NAME”.(To find OPT Name just open /parent-theme/includes/options/options-config.php and in top there’s a line $opt_name=”your_opt_name“; ) function add_product_description($sections){ $sections[10][‘fields’][] = array( ‘id’ => ‘product_extra_description’, ‘type’ => ‘multi_text’, … Read more

De-registering parent style sheet css recommended?

This is not a very smart thing to do. As you noted yourself, you’ll have issues when the parent theme is updated. Moreover, the parent theme might have secondary stylesheets that depend on the parent style (third parameter in wp_enqueue_style). There might be javascript that assumes it’s there. In other words: it will take very … Read more

Use theme constants in plugin?

TEMPLATEPATH and STYLESHEETPATH will be deprecated in the near future. It is not safe to rely on these constants. Use get_template_directory() and get_stylesheet_directory() instead. And wait until the init hook (or after_setup_theme before you use them to be sure all needed files are loaded. Example for a plugin: add_action( ‘after_setup_theme’, ‘wpse_50359_set_plugin_basics’ ); function wpse_50359_set_plugin_basics() { … Read more

Change labels of custom post type via child theme

$wp_post_types is a global array that holds post_type objects, which in turn have a labels property. You can change $wp_post_types[$post_type]->labels after the parent theme has set the CPT. Add higher priority to init hook. Add the following code in your theme’s functions.php file. For more information, check out the codex article on get_post_type_object. function change_post_object_label() … Read more

Child-theme breaks site

Your parent theme is probably broken. I guess it is using code like this: require_once get_stylesheet_directory() . ‘/admin/options-framework.php’; So it will search in the child theme for files that are present in the parent theme only. It should use get_template_directory() instead.