Articles of custom taxonomy

JSON API – search by custom taxonomy

I am trying to get the posts base on some parameters. My JSON API query is as follow. http://www.example.com/api/get_posts/?post_type=job_listing&page=10&count=5/ Here is my JSON result for custom post. So I want to pull the post by “taxonomy_job_loc”. “taxonomy_job_loc” is custom taxonomy. May I know how can I search by custom taxonomy. “posts”: [ { “id”: 16107, […]

How to query Posts from a custom post type which contains a custom taxonomy?

I have the following: $queryResponse = new \WP_Query(array( ‘post_type’ => ‘portfolio’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘portfolio_date’, ‘field’ => ‘name’, ‘term’ => $dateSelected ) ) )); var_dump($queryResponse); $dateSelected is ‘2015’. I want: All posts from post type of portfolio with a custom taxonomy of portfolio_date (Actual name: Portfolio Date. This is what the user […]

Non-permalink custom taxonomy not found

I’m posting this as I found the problem, but it took me ages to find it with the mass of ‘Refresh your permalinks’ answers. <?php add_action( ‘init’, ‘mytheme_create_post_type’ ); function mytheme_create_post_type() { // jobs custom post type // set up labels $job_labels = array( ‘name’ => __( ‘Jobs’ ), ‘singular_name’ => __( ‘Job’ ), ‘add_new’ […]

Copy/Move selected taxonomy terms to another taxonomy for posts

I’ve been searching for about 2 hours now on a solution of copying/moving selected taxonomy values for each posts to another. Here’s the situation. I’m working on a site that has a post type of articles and I’m moving them back to the innate post post type. Within the articles, I’ve had a taxonomy that […]

How to change single custom post template by custom taxonomy?

Working on a publication (wordpress based) website, having a custom post type “article” with custom taxonomy : language (with only two options: French, English). I made a custom post type template (single-article-french.php) for only French language articles (English ones will be displayed using the single-cpt.php template). How can i make wordpress change automatically the template […]

Calling related posts to a custom post type, taxonomy & Tag id

I’m trying to call the related posts of a custom post type by the category of the post that is loaded on the page. Below is where I am at – <?php $blogcats = get_the_term_list(); if (( ‘post’ == get_post_type() )) { $posttypenews = ‘post’; } if (( ‘blog’ == get_post_type() )) { $posttypenews = […]

Renaming Custom Taxonomy Values

I’m new to WordPress and have been tasked to migrate an existing non-Wordpress site to WordPress. Our original site has each page associated to a country. I’ve been reading a lot and I believe I need to create a custom post type (“Country Pages”) and a custom taxonomy (“Country”). The problem I have is with […]

Sort and paginate custom post taxonomies alphabetically

I need to sort and paginate custom taxonomy post types. i have a page where i have next and previous link. on clicking next and previous link next or previous brand(custom taxonomy) should load. I have achieved this so far $terms = get_the_terms( get_the_ID(), ‘brand’ ); if($terms) { $BrandId=$terms[0]->term_id; $nextBrandId=$BrandId+1; $prevBranId=$BrandId-1; $next=get_term_by(‘id’, $nextBrandId, ‘brand’ ); […]

URL rewriting taxonomy term

I’m trying to find solution for the following hours now and i don’t know if this is applicable. I have 1 Custom Taxonomy “Years” for Post Type “Post (default)”. The taxonomy has 2 Terms: “2014” and “2015”. I have select some posts from category “news” to use the 2 different Taxonomy terms. This shows me […]

Get child categories of custom taxonomy category?

I am using custom post type : portfolio and have taxonomy for that portfolio_category. I need to get sub categories for a particular category using the above custom taxonomy. In short, How can I get the child categories for taxonomy=portfolio_category&tag_ID=80&post_type=portfolio?