Articles of custom taxonomy

Why doesnt this query work? (Custom Taxonomy)

My Query $my_query = array( ‘posts_per_page’ => 10, ‘tax_query’ => array( array( ‘taxonomy’ => ‘country’, ‘field’ => ‘id’, ‘terms’ => array(4) ) )); Added Custom Taxonomy Using function taxonomy_init() { // create a new taxonomy register_taxonomy( ‘country’, ‘post’, array( ‘label’ => __(‘Countries (Labels)’), ‘sort’ => true, ‘args’ => array(‘orderby’ => ‘term_order’), ‘rewrite’ => array(‘slug’ => […]

Taxonomy page not working

I have a taxonomy register with name doctor-services and I have a taxonomy template with name taxonomy-doctor-services.php but when I click on taxonomy link it does not display detail of the taxonomy. Here is a code function doctors_custom_post(){ $labels = array( ‘name’ => ‘Doctors’, ‘singular_name’ => ‘Doctor’, ‘add_new’ => ‘Add Doctor’, ‘add_new_item’ => ‘Add New […]

Which file/template is in charge of taxonomies for custom post types?

I have set up a CPT, lets say “Movies”. ‘rewrite’ => array( ‘slug’=>’movies’, ‘with_front’=>FALSE ) I added a taxonomy “Genre”. ‘rewrite’ => array( ‘slug’=>’movies/genre’, ‘with_front’=>FALSE ) I also tried ‘rewrite’ => array( ‘slug’=>’genre’, ‘with_front’=>TRUE ) register_taxonomy( ‘category_movie’, ‘movie’, $args ); Everything works, but, when I want to browse some movies e.g. in the category/taxonomy horror […]

How to create filterable portfolio in WordPress?

I’m creating a Portfolio custom page in WordPress, so far I’ve been able to get the categories from the custom taxonomy. Now what I want is when clicking on an option, it should fetch the post with the custom category. This is what I have so far: <div class=”row”> <div class=”col-lg-12″> <div class=”pull-right”> <button class=”btn […]

Display children category images

I have worked four hours on this but with no result. There is a custom taxonomy and I need to display the image of the child category but displays the image of parent category. My code is: <?php $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); $queried_object = get_queried_object(); $term_id = get_queried_object() […]

Listing all slugs?

I have a number of slugs and items in my custom category: SLUG – number video – 5 items music – 5 items [no-slug] – 5 items empty – 0 items blabla – 0 items I want to list all non-empty slugs (otpionally with number of items next to them), like: [ video (5) ] […]

Listing titles and custom fields of entries within subcategories

I have a custom taxonomy setup – Downloads. Within downloads I have several subcategories. I’d like to list the titles of those entries, with the entry title being a link to an Advanced Custom Field (text type). I have something that loops through and prints the subcategory names, but I’m stuck on how to display […]

Clean Custom URL for Serach + Custom Taxonomy

I have a custom taxonomy, called filter. All of the following urls lead to the archive.php and should give me at least 1 post. /filter/bar works by default, no custom rule needed /myCategory/filter/bar works with my own custom rule, nice! /search/foo works by my custom rule /?s=foo&filter=bar works as expected /search/foo/filter/bar BOOM! No entries Here […]

Taxonomy with_front causes all

I have a custom taxonomy, which sets the with_front to false to try and get the URLs to look like /%type%/%brand%/%product%/, degrading as we go down. This however is driving me nuts. Everything in the code works, this works, but it causes every other page on the site to 404. I’d imagine the reason is […]

looping though custom post types and only return results in a given taxonomy

I am creating a WordPress theme for a record label. One aspect is the video gallery. I created the gallery using a custom post type called ‘videos’. The code below is what I placed in my functions.php file to set up the post type: add_action( ‘init’, ‘create_my_post_types’ ); function create_my_post_types() { register_post_type( ‘videos’, array( ‘labels’ […]