Tag Info

Hot answers tagged

1

Well, I’d like to expose my experience in sorting custom post types by category/taxonomy. THE WEB A travel agency web site running on WordPress Main content on custom post type called ‘ruta’ Taxonomy with this structure Type-of-travel > continent >country THE CASE In archive category list pages, the client wanted the posts to be sorted by The ...


1

I wouldn't call it a bug, you haven't done anything to place that restriction on the query for your post. It also seems like a fairly unlikely case where random strings will end up in place of your taxonomy terms for this to even present itself. Anyway, the answer is to modify the query via pre_get_posts to add in whatever taxonomy data you need. I don't ...


1

You can use categories with pages by registering the category taxonomy for the page object type: function categories_for_pages(){ register_taxonomy_for_object_type( 'category', 'page' ); } add_action( 'init', 'categories_for_pages' ); If you want to use a separate taxonomy for this, you can register your own taxonomy for pages.


1

Try adding this in your functions.php file: // Let's stop WordPress re-ordering my categories/taxonomies when I select them function stop_reordering_my_categories($args) { $args['checked_ontop'] = false; return $args; } // Let's initiate it by hooking into the Terms Checklist arguments with our function above ...


1

Does this work? global $post; // make sure the post object is available $slug = $post->post_name; // get the slug // insert the slug into your query $args = array( 'post_type' => 'client_prop', 'posts_per_page' => 10, 'tax_query' => array( array( 'taxonomy' => 'prop_neighborhood', 'field' => 'slug', 'terms' => ...



Only top voted, non community-wiki answers of a minimum length are eligible