Browser title script ignoring is_page /else conditional [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years … Read more

Override Constants in Child theme

I have a parent theme that declare these constant in function.php: define(“THEME_DIR”, get_template_directory()); define(“THEME_DIR_URI”, get_template_directory_uri()); define(“THEME_NAME”, “BARNELLI”); define(“THEME_STYLES”, THEME_DIR_URI . “/css”); define(“THEME_INCLUDES”, THEME_DIR . “/includes”); define(“THEME_POST_TYPES”, THEME_DIR . “/includes/post-types”); define(“THEME_INCLUDES_URI”, THEME_DIR_URI . “/includes”); define(“THEME_FONTS”, THEME_DIR_URI . “/font-awesome”); i need to modify some files included in includes directory and copy the directory structure (including files). As … Read more

Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?

I am a real fan of the Allman (BSD) coding indent style. However, when i review the top rated plugins on WordPress, i am finding them using the K&R coding indent style. Is there a requirement from WordPress.org that forces users to use the K&R indent style when developing plugins or themes? I read all … Read more

Why does WP recommend against custom favicon functionality in themes?

I am developing a WordPress theme, and when reading the Codex article on Theme review, WP recommendeds against allowing custom favicons in a theme. Does anyone know the reason for this recommendation? From the Codex: Favicons Themes are recommended not to implement custom favicon functionality. If implemented, favicon functionality is required to be opt-in, and … Read more

WordPress codex: apply_filters – clarification on creating a new hook on the fly. How do we use it?

I have read the WordPress Codex on add_filter and apply_filter countless times, but it wasn’t until reading woocommerce source code today that something clicked in the way that maybe I don’t understand the way apply_filter works or maybe I don’t quite understand how it creates a new hook and when/where is the function defined for … Read more

Whats the difference between blog_info(‘stylesheet_url’) difference get_stylesheet_uri()

The question is in the title really. What is the difference between blog_info(‘stylesheet_url’) difference get_stylesheet_uri(), and if it’s a case that one is newer then which. The codex says: ‘stylesheet_url’ – Returns the primary CSS (usually style.css) file URL of the active theme. Consider using get_stylesheet_uri() instead. 1 Answer 1 Actually bloginfo( ‘stylesheet_url ) uses … Read more

*Just curious* I erroneously used hook add_action() instead of add_filter() and there was no error and the result was correct. Why is that?

While working on a project I used the incorrect hook type add_action() which does not exist, yet there was no error notice and the correct result returned. I only realized it was wrong while searching for the method along with the $hook_name name in the package and it was not found, and when I checked … Read more

How can i list current author’s categories?

My Code getting authors written post categories but just 2 ID has author lists category.. I replace $current_user->ID but it is not worked. <?php $categories = $wpdb->get_results(” SELECT DISTINCT(terms.term_id) as ID, terms.name, terms.slug FROM $wpdb->posts as posts LEFT JOIN $wpdb->term_relationships as relationships ON posts.ID = relationships.object_ID LEFT JOIN $wpdb->term_taxonomy as tax ON relationships.term_taxonomy_id = tax.term_taxonomy_id … Read more