Tag Info

New answers tagged

1

I try this code and it solve my problem if ( is_child_theme() === false ) { // files moved } else { // do nothing } Thankx to @birgire


0

You could try the following: add_action( 'switch_theme', function( $new_name, $new_theme ) { if( is_a( $new_theme->parent(), '\WP_Theme' ) ) { // Child theme was activated } else { // Parent theme was activated } }, 10, 2 ); to see if the theme you just activated is a child theme or not.


0

I think I found a solution, but before a little Premise load_theme_textdomain() and load_child_theme_textdomain() are basically equal, the only difference is the default path they use: they get the current language (using get_locale()) and add the relative .mo file to the path passed as argument; then they call load_textdomain() passing as argument both ...


0

You can use language files that are in your child theme folder. First you have to know which text domain the parent theme is using. Then create the .po and .mo files with only your language as the file name (e.g. de_DE.po/de_DE.mo or nl_NL.po/nl_NL.mo) and put them into a folder within your child theme directory, "languages" for example. You can then ...


0

You can use get_stylesheet_directory_uri(); while enqueuing the scripts and styles. It returns the directory path in which your child stylesheet is stored.



Top 50 recent answers are included