Child themes, over riding in the parents theme

The answer is to remove things in your child theme via an action that runs before the action the parent theme has hooked to, everything should be happening within an action of some sort. For example, in your parent theme: function do_something(){ // something happens here } add_action( ‘init’, ‘do_something’ ); Then in your child … Read more

lost css when overriding themes templates

Without seeing the code, I would guess that your main stylesheet is being loaded by get_stylesheet_directory_uri() or something of that nature. Now that you’ve copied header.php into your child theme get_stylesheet_directory_uri() is looking in YOUR theme for that stylesheet. It isn’t there and thus you have no CSS. Change the stylesheet directory to get_template_directory_uri() and … Read more

How Child Themes Directory works for plugins?

Plugins are not kept in the theme directory. It doesn’t matter if you are using a child theme or not. Maybe you’re asking a different question? Are you asking how to make a “child-plugin”? Plugins are generally kept here: wp-content/plugins. Whereas child themes and themes are kept here: wp-content/themes As far as “child-plugins” there is … Read more

Update Data parameter of a wp_localize_script() call

wp_localize_script results in your data being printed to the page before your script tag via PHP, whether it be in wp_head or wp_footer, depending on where you’ve set your script to be output. Calling wp_localize_script from an AJAX handler won’t do anything, you’re returning data via JavaScript. What you can do is put any data … Read more

How Do I Get My Post Tags to Alphabetize?

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.

Child Theme header1.php file not overwriting parent theme’s header1.php file

That edit explains it. Alphabet is poorly written. Its use of php’s include rather than WordPress’s own include functions like get_header and get_template_part is breaking the parent/child hierarchy. You could probably make a copy of the file header.php and change those includes, as long as the file calling in header.php does it correctly! As long … Read more