Order Posts by Taxonomy and Meta Value

In your code, there is if ( isset( $wp_query->query[‘orderby’] ) && $taxonomy == $wp_query->query[‘orderby’] that make your code not work with multiple order fields, because if you set ‘orderby’ => ‘taxonomy_cat meta_value’ then $taxonomy == $wp_query->query[‘orderby’] is never true. In addition, I find that looping all taxonomy only with the aim to find the taxonomy … Read more

Custom taxonomy on users with UI

Answering this question is, by design, a multi-part process. There are several things you (or a plugin/library) need to do to make User Taxonomies behave similarly to Post Taxonomies, even after you have (successfully) registered it. This answer is a work-in-progress to some degree. Please add other answers with solutions to any aspects that are … Read more

Multiple users – only allow them to manage their own terms for custom taxonomy when logged in

Thanks for the AWESOME solution MikeSchinkel 😀 I just did the following updates in the code and it worked like a charm: add_filter(‘list_terms_exclusions’, ‘yoursite_list_terms_exclusions’, 10, 2); function yoursite_list_terms_exclusions( $exclusions ) { $currentScreen = get_current_screen(); if( current_user_can( ‘my_custom_capability_assigned_to_specific_users’ ) && !current_user_can( ‘manage_options’ ) // Show everything to Admin && is_object( $currentScreen ) && $currentScreen->id == ‘edit-<my_taxonomy>’ … Read more

Archive template for taxonomy terms

I want to document this because I just found the answer recently. The problem with having taxonomy is that most developers have the mindset of expecting the taxonomy to be seen inside the post_type url of: http://hostname/post_type/taxonomy_term Instead, you are going to find the url in: http://hostname/taxonomy_slug/taxonomy_term This means that we often may be creating … Read more

Disable Single Post View for Specific Taxonomy on Custom Post Type

I use template_redirect hook for this purpose. I suppose rented in your question is not taxonomy itself, but one term of some taxonomy. function my_page_template_redirect() { if( is_singular( ‘rentals’ ) && has_term(‘rented’, ‘your taxonomy name’) ) { wp_redirect( home_url(), 301 ); exit(); } } add_action( ‘template_redirect’, ‘my_page_template_redirect’ ); Before page rendering, WP checks if CPT … Read more

How to overwrite a specific parameter in a core taxonomy?

Version 4.4 saw the introduction of the register_taxonomy_args filter in register_taxonomy() which you can use to filter the arguments used to register a taxonomy /** * Filter the arguments for registering a taxonomy. * * @since 4.4.0 * * @param array $args Array of arguments for registering a taxonomy. * @param array $object_type Array of … Read more

Sorting custom taxonomy causes menus error

Currently your code is modifying all term queries, both in the front-end and in the back-end. Each navigational menu is registered as a term in the nav_menu taxonomy, so when you visit the backend to work on the menus, those queries have been modified too by your code snippet. For example, I don’t see any … Read more

check if tag exists in wp database

I think you’re looking for term_exists function. Example Code: <?php $term = term_exists(‘tag1’, ‘post_tag’); if ($term !== 0 && $term !== null) { echo “‘tag1’ post_tag exists!”; } else { echo “‘tag1’ post_tag does not exist!”; } ?>

List taxonomy terms as links

My apologies. After some more searching, I found that I could pass the taxonomy as an argument in wp_list_categories. Here is the info via WordPress Codex.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)