First, your taxonomy code has a missing comma before $args
which is causing a fatal error:
register_taxonomy( 'product_category', 'product', $args );
Enable debugging while working on code to see PHP errors, which would reveal the line number and error.
As for your post type, you have a page where you can view all products, which is the post type archive. This argument in your post type registration code enables that:
'has_archive' => true
But since you’ve only set it to true
, it will use the post type name as the archive slug, so your archive is located at:
mysite.com/product/
To change that, simply set it to the slug you want to use:
'has_archive' => 'products'
Then your archive will be located where you want it:
mysite.com/products/
Remember to visit your Settings > Permalinks
page after making changes that effect permalinks, this will flush the rewrite rules.
Related Posts:
- WP_Query by a category id and a custom post_type
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Custom Posts Types using Posts Category
- category__in not working on custom post type
- how do I group content in magazine-style ‘issues’?
- How to get a list of term names of the custom post type im currently on in single.php
- Use standard WordPress categories with a CPT
- Categories or Custom Post Type to Organize Content
- How can I add single catogory for custom post type?
- Get the post_type of current taxonomy or category page
- Custom post type taxonomy template
- Categories and Tags not working!
- automatically save custom post type title as a category
- Page naming when there is a sub-category only sometimes.
- get_categories() for only CPT
- Category page only displaying the posts from a custom type
- category.php displays ALL posts instead of just those with the current category
- custom taxonomy archive by year
- Display Next/Prev when looping Custom post-types archive?
- Possible for Category Base and Custom post Type to share the same slug/permalink?
- Weird problem happening with custom taxonmy when creating/updating posts
- Pagination on category page with custom post types
- Call custom post type by category
- How to detect filter in URL in Category page?
- CPT Archive with core Category
- Replace li Items with divs with classes
- showing custom post types of a certain category only
- Get posts from a custom post type by child categories of a parent category
- get_posts() with custom post type does not work outside page.php
- Show a Category X’s custom post type on Category X archive page?
- Multiple level category drop-down from the WordPress dashboard
- Filter CPT posts by one or more categories
- Getting categories of posts under a custom taxonomy
- How to get categories linked in posts for a specific post type
- WP Query with categories only shows one post and ignores the category
- How to edit this code to get the categories in achieve page?
- Get the category from custom post type
- How to create a gallery page with categories?
- Loop filtering Custom Post Types and/or Categories
- Best method to make posts searchable, sortable and filterable – custom field, tag or category?
- Cross reference custom post types
- Make a custom_post translatable
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Custom templates for a specific category
- How to retrieve category of a post in have_post loop?
- Categories and tags for custom post types
- Archieve.php not loading for custom post type
- How to add current custom taxonomy slug to body class
- Assign category a default post type
- Meta data (Tags and Categories) for Custom Posts not showing.
- Custom post types with categories in template
- Need help deciding on a taxonomy
- Get Posts by Category, Tag , and CPT Taxonomy
- The Difference Between Categories and Tags and Taxonomies and Terms
- Get assigned post categories
- Default Category Page not showing custom post type which has taxonomy category
- Custom Post Type posts not showing in category
- Post Query not working
- Category Name with Custom Post Type
- cannot achieve this structure (custom posts VS categories VS ??)
- Am I mixing up the concept of posts pages and categories?
- CPT archive page – show one post from each taxonomy term
- how to organize my categories or should I do custom post types for some?
- Order Categories by Hierarchy?
- Multiple categories assigned to a single product breaking the breadcrumb
- How to divide Subcategories into pages of parent category wordpress
- Custom front-end form for adding post – Category problem
- Custom post type archive page filters
- Custom Post Type Category Displaying ALL Sub Categories as well
- Control over custom post types on a specific page
- Custom query using one category that is used in all custom post types
- get taxonomies from terms
- create a “add icon” field in taxonomies page
- Feature image Gallery made from Custom Post type + Categories
- To display the category of a specific custom post type
- Get meta values from parent post and save in child post
- Use Category for Custom Post Type – But Need Another Separate Archive Page too
- Only show current category post
- Custom post type category archive URL redirects to home page
- how to use two permalinks for one custom post type based on categories
- Get full control over custom post type url
- How to switch from custom post type URL to category URL?
- Custom Catagory not found
- Page to show custom posts and one category
- How can I list custom post by custom category?
- Using get_terms() as shortcode attribute
- category_name not working in WP_Query
- how to show perticular category posts in custome page
- Use only selected regular categories for a Custom post form
- Bulk remove category from custom post type?
- Problem with menu categories doubling up when updating database?
- Remove slug from Custom Category Permalink + dual-category permalinks
- How to query posts by category with the_title();
- Show custom post type on post category page doesn’t work / breaks navigation
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- How to separate posts by categories?
- Custom Post Types Permalink
- How to add categories to a custom post type using wp_insert_post($new_post);