Hot answers tagged

4

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 ...


3

You could use the filter term_links-post_tag to sort tags while ignoring their case: add_filter( "term_links-post_tag", 'themeslug_sort_tags_alphabetically' ); function themeslug_sort_tags_alphabetically( $tags ){ natcasesort( $tags ); return $tags; } This code is to be placed in the functions.php of the child theme.


2

Stick to filtering one value at a time to keep it simple, and add filters for the colors to be used by the child theme: add_filter( 'post_thumbnail_html', 'map_thumbnail'); function map_thumbnail($html) { $my_post = get_post($post->ID); $defaultcolor1 = "#??????"; // parent theme default $defaultcolor2 = "#??????"; // parent theme default ...


1

you need to enqueue styles in child theme's function.php to override parents styles. if you want to completely removed parent's bootstrap css then use wp_dequeue_styles() function and enqueue new bootstrap css in child theme's function.php http://wpsites.net/web-design/how-to-deregister-dequeue-style-sheets/


1

All the information you need can be found here: https://codex.wordpress.org/Child_Themes The important parts to get it up and running would be to: Make sure the parent theme exists (the complete accesspress-lite theme in your case) Create a unique folder name for your child theme. Create a style.css file in your child theme folder. /* Theme Name: Your ...


1

You can use get_stylesheet_directory() to refer to your child theme, then you can point to your file. require_once( get_stylesheet_directory() . '/includes/theme-styles.php' ); It will load your file and replace the parent theme file.


1

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 ...


1

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.


1

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


1

You can get this value about the child theme. At first get your child theme date. The simplest way is the function wp_get_theme(), see codex for the parameters and more information. You get a object with all relevant information about the current theme. In step two check, if is a child theme and then get his parent information, like the follow source. // ...


1

Thanks for all the help which pointed me in the right direction. In the end I used the following: $style_parent_theme = wp_get_theme(get_template()); $style_parent_theme_author = $style_parent_theme->get( 'Author' ); I use get_template() to recover the folder name of the parent theme. wp_get_theme then get's the theme object. Once we have that we can ...


1

You have two options here In a child theme, dequeue and deregister the scripts and style you are not going to need. Just remember to hook your function to wp_enqueue_scripts with a lower priority (higher number) Use the twentyfifteen as a base to a new theme. I have successfully used bundled themes in the past to create new, selfstanding themes. That is ...


1

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 ...


1

There are a few steps you'll need to take, to switch parent themes. Create a Backup of the Original Child Theme If you have FTP access, log into [root]\wp-content\themes\ and download the child theme folder to your your computer. Copy and rename the entire child theme folder. This will be your new child theme. If you don't have FTP access, it's probably ...



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