Isn’t there a permalink structure that will essentially list out all categories
of a certain post type
?
function create_faqs_post_type() {
register_post_type( 'faqs',
array(
'labels' => array(
'name' => __( 'FAQs' ),
'singular_name' => __( 'FAQ' )
),
'public' => true,
'menu_position' => 5,
'rewrite' => array('slug' => 'the-faqs')
)
);
}
add_action( 'init', 'create_faqs_post_type' );
function create_faq_taxonomy() {
register_taxonomy(
'faqs_categories',
'faqs',
array(
'hierarchical' => true,
'label' => 'FAQs Categories',
'query_var' => true
)
);
}
add_action( 'init', 'create_faq_taxonomy' );
This is the code I’ve using to register the custom post type faqs
and then register a taxonomy for it.
Isn’t there a permalink structure that will essentially automatically list out all faqs
of a certain taxonomy? Or do I need to create a custom template and query it specifically?
@dcolumbus
You can do a permalink rewrite when you register the taxonomy using the following:
‘rewrite’ => array( ‘slug’ => ‘faqcategories’, ‘with_front’ => false ),
Then site.com/faqcategories should pull them and site.com/faqcategories/easy should get them for you for the ‘easy’ term.
If I’m understanding you correctly.
You can use something like this:
Edited but original source here. Good luck, I hope this helps.