get_template_directory_uri pointing to parent theme not child theme

get_template_directory_uri() will always return the URI of the current parent theme. To get the child theme URI instead, you need to use get_stylesheet_directory_uri(). You can find these in the documentation, along with a list of other useful functions for getting various theme directory locations. If you prefer to use a constant, then TEMPLATEPATH is akin … Read more

Remove “Category:”, “Tag:”, “Author:” from the_archive_title

You can extend the get_the_archive_title filter which I’ve mentioned in this answer add_filter(‘get_the_archive_title’, function ($title) { if (is_category()) { $title = single_cat_title(”, false); } elseif (is_tag()) { $title = single_tag_title(”, false); } elseif (is_author()) { $title=”<span class=”vcard”>” . get_the_author() . ‘</span>’; } elseif (is_tax()) { //for custom post types $title = sprintf(__(‘%1$s’), single_term_title(”, false)); } … Read more

What’s the difference between home_url() and site_url()

You are asking two questions at once: What’s the difference between home_url() and site_url()? How do I get WordPress to return the URL root without the subdirectory where it’s installed? Here are the answers, and I confirmed with Andrew Nacin, a core developer of WordPress, as well as ran some server tests to confirm what … Read more

Between functions.php (theme), widgets, and plugins, which is loaded first?

The plugins are loaded right before theme (yes, I’ve been looking for excuse to use this): However it is wrong to think about either as point of code execution. For most cases everything should be hooked and executed no earlier than init hook. According to Codex widget registration with register_widget() should be hooked to widget_init. … Read more

Best collection of code for your 'functions.php' file [closed]

Enable Hidden Administration Feature displaying All Site Settings Tested on: WordPress 3.1 RC3 This little piece of code does something pretty cool. It will add an additional option to your settings menu with a link to “all settings” which will show you a complete list of all the settings you have within your database related … Read more