Template files for Custom Post Type and Taxonomy

The way taxonomies work with rewrites, is that they have a ‘slug’. Look at the codex under register_taxonomy, you will see the ‘rewrite’ argument. Supply it with array( ‘slug’ => ‘properties/location’ ) and refresh your permalinks. Otherwise, it’s looking for the following: mysite.com/property_location/office-space Refer to @vancoders answer for the template solution.

using wp_tag_cloud with custom taxonomy

Is the normal behavior of wp_tag_cloud: it show all tags, not only the tags for a specific post, even if inserted in a singular page. However, that function has an option include that let you define the tags to include (must be comma separed list of tag ids). So, in your template file, pass that … Read more

2 custom post-type and 1 taxonomy

For jobs in Newyork: $query1 = new WP_Query( array(‘post_type’ => ‘job’,’city’=>’new-york’) ) For resumes in Newyork: $query2 = new WP_Query( array(‘post_type’ => ‘resume’,’city’=>’new-york’) ) Is this what you need ?

Get the taxonomy of the post

All I need is to find the taxonomy(ies) of post of a custom post type. It can output in any look or format and I can make it work That being the case, what you need is get_object_taxonomies() $taxonomies = get_object_taxonomies( ‘post’, ‘objects’ ); That will not give you the terms in the taxonomies. You … Read more

How do I add a Custom Post Type that looks and behaves exactly the same as Posts?

Creating the Post Type register_post_type is your friend here. This is what plugins etc use to register the post type. For example here is a basic Books post type: function codex_custom_init() { $args = array( ‘public’ => true, ‘label’ => ‘Books’ ); register_post_type( ‘book’, $args ); } add_action( ‘init’, ‘codex_custom_init’ ); If you don’t want … Read more

Best way to specify “article type” in URL

here’s a way to add article type with tags. First we add the taxonomy to our post add_action(‘init’, ‘article_type_init’); function article_type_init() { if (!is_taxonomy(‘article_type’)) { register_taxonomy( ‘article_type’, ‘post’, array( ‘hierarchical’ => FALSE, ‘label’ => __(‘Article Type’), ‘public’ => TRUE, ‘show_ui’ => TRUE, ‘query_var’ => ‘article-type’, ‘rewrite’ => true ) ); } } Than we hook … Read more