Give priority to child theme stylesheet

Your child theme’s stylesheet will usually be loaded automatically. If it is not, you will need to enqueue it as well. Setting ‘parent-style’ as a dependency will ensure that the child theme stylesheet loads after it. /** * Enqueue theme styles (parent first, child second) * */ function wpse218610_theme_styles() { $parent_style=”parent-style”; wp_enqueue_style( $parent_style, get_template_directory_uri() . … Read more

Git vs Child Theme

While I know version control approach to be used in practice, I don’t think it’s too common. WP has weak version control practices in general, so development of extensions doesn’t quite plan for such. Example of specific scenario which will cause issues might be changes in template hierarchy. Let’s say you customized single.php in version … Read more

get_parent_theme_file_path vs. get_template_directory

Is there a specific reason to use get_parent_theme_file_path() over get_template_directory() Yes. This new function comes with a filter Filter parent_theme_file_path And argument to the file path If you take a look at the get_parent_theme_file_path() source, it’s just returning get_template_directory() with extra functionality like if a file is given as an argument to the get_parent_theme_file_path it … Read more

Hiding Parent Theme

There is a filter called wp_prepare_themes_for_js in wp-admin/includes/theme.php in the wp_prepare_themes_for_js() function, which is called by wp-admin/themes.php to populate the theme set. That filter will allow you to remove themes from the list. Of course, you have to know the theme name. function kill_theme_wpse_188906($themes) { unset($themes[‘twentyten’]); return $themes; } add_filter(‘wp_prepare_themes_for_js’,’kill_theme_wpse_188906′);

How to override function in child theme

I am not sure if the function in the functions_custom.php that you wants to override is a pluggable functions like below: if ( ! function_exists ( ‘function_name’ ) ) { function function_name() { // Function Code } } If it is pluggable function then you can simply write function with same name in your child … Read more

@package & @subpackage: how to use with child themes

Rule of thumb: is your code bundled (i.e. packaged) with whatever code indicated by @package? If no, then you are using an incorrect value for @package. For the case of most Themes, this is easy: Core-bundled Themes use @package: WordPress and @subpackage Theme-Name, because they are packaged and distributed with WordPress itself All other Themes … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)