Remove alphabetical order from wordpress categories

Here you go: just place this in your functions.php: /** * Sort post_tags by term_order * * @param array $terms array of objects to be replaced with sorted list * @param integer $id post id * @param string $taxonomy only ‘post_tag’ is changed. * @return array of objects */ function plugin_get_the_ordered_terms ( $terms, $id, $taxonomy … Read more

Custom Post Types and independent Categories – complex Taxonomy

In wordpress, the slug (post name) is unique per post type. So, an url like /company-1/items/item-type-1/product-1 and one like /company-2/items/item-type-1/product-1 where product-1 is the post name, cannot address to 2 different products. If you create 2 products with same title WordPress on saving will set an unique slug. Same thing is for articles. For this … Read more

Show only 1 term of a current posts taxonomy

This is more PHP than WordPress, but wp_get_post_terms returns a numerically indexed array, so all you need is basic PHP array syntax to grab the first item. $terms = wp_get_post_terms($post->ID, ‘custom_cat’); print_r($terms[0]->name); You don’t specify which item you want. This will get you last item: $terms = array_pop($terms); print_r($terms);

Normal pages as children of my Custom Post Type

If it were me, here’s how I’d achieve this. Preface Assuming the following data structures: Post type: “dictionary” Taxonomy: “dictionary_category”, terms limited to single letters And the desired URLs: /dictionary/ => page (this should work out-of-the-box) /dictionary/rules/ => page /dictionary/x/ => Taxonomy archive /dictionary/x/xavier/ => Single post view 1. Set the post type and taxonomy … Read more