Create multiple rewrite endpoints for custom taxonomy archive

This code above works fine up to one endpoint but not working for multiple endpoints like following https://example.com/dogs/shop/prod-cat1 https://example.com/dogs/shop/prod-cat2 https://example.com/cats/shop/prod-cat1 https://example.com/cats/shop/prod-cat2 Uses template shop-cat.php & value of query variable i.e prod-cat1, prod-cat2 available on template Your request hook callback is always setting the query var to true, like so (for the shop var): if (isset($vars[‘shop’])) … Read more

List taxonomies in a dropdown in theme’s option panel

A taxonomy is a group of terms. I think you registered a taxonomy Catalogs, and now you want to list all terms in this taxonomy. You do that with the function get_terms(), not get_taxonomies(). So your $wp_tax array should be filled like this: $wp_tax = array(-1 => ‘Choose a category’); $catalog_terms = get_terms(‘Catalogs’); if ($catalog_terms) … Read more

How can you handle rewrite rules for custom post types with option to filter on custom taxonomy terms?

This is what I’ve used in the past for a similar requirement; register_post_type(‘movie’, array( ‘rewrite’ => array(‘slug’ => ‘movie’) )); register_taxonomy(‘movie_location’, ‘movie’, array( ‘rewrite’ => array(‘slug’ => ‘movies’) )); /** * Add rewrite rules for ‘base’ archives. * @param object $r Instance of {@see WP_Rewrite} */ function my_custom_rewrite_rules(&$r) { $rules = array( ‘movies/page/?([0-9]{1,})/?$’ => ‘post_type=movie&paged=’ … Read more

showing custom taxonomies w/custom post type

For the dashboard post listing bit…. http://codex.wordpress.org/Plugin_API/Action_Reference/manage_posts_custom_column // ADDS EXTRA INFO TO ADMIN MENU FOR PRODUCT POST TYPE add_filter(“manage_edit-ve_products_columns”, “voodoo_prod_edit_columns”); add_action(“manage_posts_custom_column”, “voodoo_prod_custom_columns”); function voodoo_prod_edit_columns( $columns ) { // Add the extra column for product categories instead of rebuilding the whole array $columns[‘prod_cat’] = “Product Category”; $columns[‘description’] = “Excerpt”; return $columns; } function voodoo_prod_custom_columns( $column ) … Read more

How to create new category for custom post type?

You could create a taxonomy called Job Types and your terms would be PHP Jobs etc. In your register post type function change: ‘taxonomies’ => array( ‘post_tag’, “category”), to ‘taxonomies’ => array(‘job_types’), add_action(‘init’ , ‘c3m_job_taxonomis’ ); function c3m_job_taxonomies() { $labels = array( ‘name’ => _x( ‘Job Types’, ‘taxonomy general name’ ), ‘singular_name’ => _x( ‘Job … Read more

Creating an Archive using a Custom Taxonomy

you can add the current term to you query so if its category, tag or custom taxonomy you will get the posts with the current term, try changing this: query_posts(‘cat=0&posts_per_page=12&paged=’.$paged); with this: $term_slug = get_query_var( ‘term’ ); $taxonomyName = get_query_var( ‘taxonomy’ ); query_posts(array(‘posts_per_page’ => 12, ‘paged’ => $paged, $taxonomyName => $term_slug));