List custom taxonomies associated to an author’s posts

First grab the post ids by the author, and then the terms. $author_id = ‘1234’; $taxonomy = ‘clubs’; $post_ids = get_posts(‘fields=ids&post_type=post&post_status=publish&showposts=-1&author=”. $author_id ); $clubs = wp_get_object_terms($post_ids, array($taxonomy)); $html = “<ul>’; foreach( $clubs as $club ) { $html .= sprintf( ‘<li><a href=”https://wordpress.stackexchange.com/questions/134259/%1$s”>%2$s</a></li>’, get_term_link($club, $taxonomy), $club->name ); } $html .= ‘</ul>’; echo $html;

Comma separator problem of custom taxonomy

Commas in the post page tags areas means different words, so wordpress will see 1 bedroom,2 bathrooms,4 kithenrooms as three separate words namely, 1 bedroom , 2 bathrooms and 4 kithenrooms. Create your tags to look like this 1 bedroom-2 bathrooms-4 kithenrooms or1 bedroom 2 bathrooms 4 kithenrooms

custom taxonomy listing returns no posts

Answer moved from an edit in the answer to a real answer. This is my query <?php $taxonomy = (get_post_type() == ‘post’ ? ‘category’ : (get_post_type() == ‘news’ || is_tax(‘news_categories’) ? ‘news_categories’ : ‘category’)); $tax_terms = get_terms($taxonomy, array(‘hide_empty’=> false) ); global $wp_query; if( isset($_GET[‘s’]) ): $wp_query->is_search = true; endif; // var_dump($activeCategoryName = $wp_query->queried_object); if(is_tax(‘news_categories’)) { … Read more

“Cannot redeclare cpt_reg_tax()” because of functions.php

You cannot use the same function name more than once. Give the second function a different name: add_action( ‘wp_loaded’, ‘cpt_reg_tax1’ ); function cpt_reg_tax1() { // code for the first taxonomy here } add_action( ‘wp_loaded’, ‘cpt_reg_tax2’ ); function cpt_reg_tax2() { // code for the second taxonomy here } Besides that, your code will terrible break for … Read more

Change permalinks for custom post type based on taxonomy term

Use Category base and Tag base Permalink The Category base and Tag base are prefixes used in URLs for category and tag archives, which look like this: example.net/wp/category_base/category_name example.net/wp/tag_base/tag_name The default values for these are category and tag. You can change them, but you can’t remove them from the URLs altogether. Custom permalinks work on … Read more