Articles of custom taxonomy

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?

SEO Title Tag and Meta Description for custom taxonomy

I have hierarchical taxonomy called “Location” e.g. I want and to have different title tag I want them to be … = Welcome to “state” location = Welcome to “state”, “city” location Same thing for meta descriptions. I tried configuring header.php but no luck.

does wp_insert_term link the term to a certain post ID?

I’m using wp_insert_termto add a custom taxonomy like this: wp_insert_term( $_POST[‘city’], // the term ‘property-city’, // the taxonomy array( ‘description’=> $_POST[‘city’], ‘slug’ => $_POST[‘city’] ) ); It does the job, but it doesn’t link this term to a certain post ID. Thus, my questions are: what does wp_insert_term do specifically? Does it just insert the […]

worpress sub taxonomy template

please see my code structure custom post type name : product custom taxonomy associated with product : category main category inside category taxonomy :main1, main2 etc sub taxonomy inside main1 : sub1, sub2 etc i need to create template for all sub category and this templates are same . so i need to create one […]

Using WP_Query, I want to show posts that are associated with a custom taxonomy term

I have a custom post type called event. Custom taxonomy called event categories, which has various terms. I want to show all the events that belong to a certain custom taxonomy term on a archive page. I am including the custom taxonomy term wrongly, as it displays all the events and not just ones that […]

Query only current post type using taxonomy

I have several post types “Courses”, “Institutes” having same taxonomy “country”. I am using this to get term on single-courses.php <?php $terms = get_the_terms( $post->ID , ‘country’ ); foreach ( $terms as $term ) { $term_link = get_term_link( $term, ‘country’ ); if( is_wp_error( $term_link ) ) continue; echo ‘<a href=”‘ . $term_link . ‘”>’ . […]

get_terms() parent, child and grandchild

parent1 – child1 – grandchild1 I need to show child terms of any current term (only direct child) for each term I visit. Works only for the parent (show child1) but not for the child (doesn’t show granchild1) How I can fix this issue? Thank’s $queried_object = get_queried_object(); $cpt = get_post_type( get_the_ID() ); $taxonomy = […]