A light-weight WordPress plugin to assign & query posts and custom post types based on their primary taxonomy.
- Download the plugin
- Login to your WordPress website dashboard
- Navigate to Dashboard > Plugins
- Click Add New and then Upload Plugin
- Browse to the file, select it and click Install Now
- Click Activate Plugin once prompted.
- Browse to any post or custom post type in WordPress admin.
- Check the taxonomies that you want to assign to it.
- Select the respective primary taxonomies.
- Save the post.
- Use this shortcode to query the posts:
spc_primary_term_posts
. - Use the action hook —
spc_display_primary_term_posts
— to display the queried posts in your theme.
Argument | Description | Default |
---|---|---|
term |
Term ID or name. | — |
taxonomy |
(Optional) Taxonomy name. | null |
post_type |
(Optional) Custom Post Type. | post |
post_status |
(Optional) Post status. | publish |
posts_per_page |
(Optional) Number of posts per page. | 10 |
GPL2+ © Ashar Irfan.