Custom taxonomy subcategories template page

Yes, this is achievable with the action ‘template_redirect’ I’ve left to write code to find sub-category for yourself! function my_subcat_template() { if ( <is sub category>) { include (TEMPLATEPATH . ‘/category-fun.php’); exit; } } add_action(‘template_redirect’, ‘my_subcat_template’); Update This is a better answer for your problem Put this is functions.php What it does is, it redefines … Read more

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

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

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

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