Articles of custom taxonomy

ACF vs Taxonomies

Sorry if this isn’t the best place but was hoping for some clarification on something that has been bugging me. I have several custom post types Artists Counties Venues Events Festivals Line Ups At the moment I am using ACF relationship fields so for example when adding/editing an event, I can relate it to festival […]

query multiple taxonomies

I have a function set up to show ‘Similar Products’, i.e. showing products that share the same products-category taxonomy term. This works great but I want to narrow the function even further and make it more specific. Thus I want it to look at 2 taxonomies (product-category and space) to find similar products. The current […]

How can i skip same post from taxonomy term?

I’m trying to retrieve the posts of specific taxonomy categories. I have two taxonomy categories. Category One Category Two In these two have some different and same posts. So when i retrieve the data through terms id then query return some post two times, because these posts are link from above two categories. $ourwork_cat_ids = […]

Parent & Child Taxonomy slugs in custom post permalink

I’ve registered a custom post type “book” and a taxonomy “authors” as below: add_action( ‘init’, ‘post_book_init’ ); function post_book_init() { $labels = array( ‘name’ => ‘BOOKs’, ‘singular_name’ => ‘BOOK’, ‘menu_name’ => ‘BOOKs’, ‘name_admin_bar’ => ‘BOOK’, ‘add_new’ => ‘Add New’, ‘add_new_item’ => ‘Add New BOOK’, ‘new_item’ => ‘New BOOK’, ‘edit_item’ => ‘Edit BOOK’, ‘view_item’ => ‘View […]

get_template_part for each level of taxonomy term

before we start, thank’s for your time. Structure: cpt = corsi tax = argomenti tax_term = parent tax_term_child = child tax_term_child_granchild = grandchild Current code (on taxonomy-argomenti.php): $queried_object = get_queried_object(); $cpt = get_post_type( get_the_ID() ); $taxonomy = $queried_object->taxonomy; $term_id = $queried_object->term_id; $current_term = get_term_by(‘id’, get_query_var(‘term’), $taxonomy); if((int)$current_term->parent) get_template_part(‘argomenti’, ‘child’); else get_template_part(‘argomenti’, ‘parent’); I would choose […]

Remove base slug in CPT & CT, use CT in permalink

I’ve come quite far, but can’t manage to get this to work. I’d like to remove the base slug from my Custom Post Type review and my Custom Taxonomy brand. The final result should be a URL like this: https://example.org/apple/iphone7. Right now I got this: https://example.org/review/apple/iphone7. I’ve read quite a lot and I know about […]

How to handle “the_terms” inside loop

I have been searching google but I am really confused. I am trying to display the terms of the taxonomy assigned to the post. I am using the_terms($post->ID, ‘locations’);. The custom taxonomy is hierarchical. Example: 3 terms assigned to post: USA(parent) > FL(direct child of “USA”) > Miami(direct child of “FL”). What I get: FL, […]

Displaying the category name of a custom post type

So I have a custom query, in which I’m displaying some results posts of a custom post type called “staff”. This custom post type is linked to a custom taxonomy called “department”. I am able to display results, but I am unable to print the category that’s linked to each post. This is my code: […]

How to get custom post type taxonomy

I have created a custom post type portfolio_posts using the CPT UI plugin. Using the same plugin, I have created a taxonomy portfolio_category. I have made multiple entries under this taxonomy. I want to list all the entries under portfolio_category, but all I’m getting is an empty array. Here’s what I’ve tried: $args = array( […]

Widget for adding HTML markup to a page

I didn’t know how exactly I should form my title, so the question may be little different. I am new with WordPress developing and would need some advice. I don’t need any code, I just want to hear your advice. I have a page Books, and I’d like to allow admin to add books to […]