Articles of hierarchical

Display only subcategories of a category and not sub-subcategories

I have next code and i cant get it to list only the subcategories of a category and not sub-subcategories of the category. I think the problem is the next line ‘hierarchical’ => 0, Do you know what can be the problem or what should i add in the next code to fix for what […]

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.

(get_post_ancestors == 2) is returning true on 1 as well?

I am trying to use this code: <?php if(count(get_post_ancestors($post->ID)) == 2 ) : ?> <script>…</script> <?php endif ?> to add a script to a page but only if the page is a grandchild page (3rd level down, when it has 2 ancestors): Desired Result (with code above): Parent Page Child Page Grandchild Page (show script […]

Add search to 'Parent' dropdown

I created a product catalog from custom post type pages. I used it’s hierarchy to make menus and submenus. It looked like a great idea at a time… But now this catalog grew in size and it’s very hard to find something in ‘Parent’ dropdown. Is there a way to add search there?

Ideas on how to organize a project

I know that questions that are mainly there to be discussed are not liked very much, but I still hope that you can think with me and give me some ideas. So thanks in advance to those of you, who are willing to help 🙂 I’m very new in WordPress Development and I am facing […]

Identical custom taxonomy slugs for same hierarchical children

I have a custom taxonomy (editions) and would like to have a year / month hierarchy in the taxonomy reflected in the URL structure. /editions/2016/december /editions/2017/december /editions/2018/december WordPress doesn’t seem to allow me to create this on the admin side. Is this possible? For reference, here is my custom taxonomy setup inside of my functions.php: […]

Remove base slug in permalinks of hierarchical custom post type

I have a hierarchical Custom Post Type called project, registered as follows: register_post_type( ‘project’, array( ‘public’ => true, ‘hierarchical’ => true, ‘rewrite’ => array( ‘with_front’ => false ) ) ); The URLs currently look like this: I would like the URLs to look like this: How can I most efficiently accomplish […]

Display hierarchical subterms of custom taxonomy based on depth

There is the following hierarchical taxonomy structure of a specific post: Term A SubTerm A.1 SubTerm A.2 SubTerm A.2.1 Term B SubTerm B.1 SubTerm B.1.1 SubTerm B.1.2 How to display all parent terms (result: A, B) all second level terms (result: A.1, A.2, B.1) all third level terms (result: A.2.1, B.1.1, B.1.2)

Migrating Hierarchal Taxonomy Categories Between Post Types

I’m migrating about 500 posts (WooCommerce products, actually) to a new Custom Post type (using Convert Post Types plugin) and want to also migrate the Categories. There are the Taxonomy Converter plugin which migrates the categories themselves, but not their hierarchies, though it says it will. There’s also simply running: UPDATE wp_term_taxonomy SET taxonomy=’project-category’ WHERE […]

Hierarchical Custom Post Types – Show only parent on tax archive?

I have a cpt of Accommodation Taxonomy of Region Regions are then added like USA, Canada etc Then for the posts: I create a post for a whatever Resort and a child posts of whatever Hotel in that resort ( Hierarchical ) and assign it to a tax term like USA All good and working […]