Use custom field as tag slug

first get tag slug from your saved meta key my-tag-slug in a variable $tag_slug = (isset(get_post_meta(get_the_ID(), ‘my-tag-slug’, true))) ? get_post_meta(get_the_ID(), ‘my-tag-slug’, true) : null; now query posts by $tag_slug replace showposts with posts_per_page $args = array( ‘tag’ => $tag_slug, ‘posts_per_page’ => 5, ‘caller_get_posts’ => 1 ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo … Read more

Category / Custom Post Type permalink issue

A few issues- there is no %book_type% rewrite tag, your rewrite tags are %book% and %chapter%. Change all instances of %book_type% to %book%. Your taxonomy slug should just be ‘rewrite’ => array( ‘slug’ => ‘books’), the rewrite tag shouldn’t be in there. Last (minor) issue- In your post_type_link filter, you should wrap the fetching of … Read more

Get one custom taxonomy category

Your logic looks to me like it boils down to “if union is selected, then echo a link to union, else do nothing.” I think your description is much too complicated. It looks like you can effectively ignore paid completely. function wpv_check_for_union_func($attr,$content=””) { global $post; $taxonomy = ‘yourtaxslug’; $union = has_term(‘union’, $taxonomy, $post); if ($union) … Read more

Custom taxonomy archive not showing posts of certain child taxonomies

What you are calling “filter” is just a HTML select element. You need the put the select element in a form and filter the posts based on the selected option of this select element. For example, for the frontend: The form: <form method=”post” action=”<?php echo get_post_type_archive_link(‘rlt_rule’);?>”> <?php $filter_taxonomy = ‘rlt_rule_headline’; wp_dropdown_categories( array( ‘show_option_all’ => ‘Show … Read more

Taxonomy Parameters in WP Query to get posts from two different taxonomies

terms parameter of tax query is required. Just pass to it all the terms for taxonomy $args = array( ‘post_type’ => ‘cars’, ‘tax_query’ => array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘brand’, ‘field’ => ‘slug’, ‘terms’ => ‘bmw’ ), array( ‘taxonomy’ => ‘color’, ‘field’ => ‘id’, ‘terms’ => get_terms(‘color’, array(‘fields’=>’ids’) ) ) ) ); Note … Read more

Getting grandchildren of a post with a specified custom taxonomy?

I was able to achieve this by, funnily enough, using with get_pages() and WP_Query(). I wanted a reusable function that would return a WP_Query array that I could loop through, so I came up with this: function returnChildGeographies($geoID, $geoType, $grandChildren = false) { $args = array( ‘post_type’ => ‘geographies’, ‘posts_per_page’ => -1, ‘orderby’ => ‘post_title’, … Read more