I have the following custom field for a "Ticket" post type:
Name: Status
Slug: ticket-status
Type: Select
Options:
- New
- Progress
- Waiting
- On Hold
- Closed
I would like to be able to display all options and their post count so it will look like this
New (5)
Progress (9)
Waiting (3)
On Hold (1)
Closed (25)
How do I achieve this?
Laura
Supporter
Languages:
English (English )
Hi,
to display your CPT, you should create a Content Template for it.
In our Documentation we have several pages and guides on how to do it. Read it here:
https://toolset.com/documentation/getting-started-with-toolset/create-templates-to-display-custom-posts/designing-a-template-without-any-page-builder/
https://toolset.com/documentation/user-guides/view-templates/
About displaying the count number for each custom field, you need to create a View for this. In Views, you can add a filter for custom fields and you’ll get the chance to add a count option. You should get a shortcode similar to this one:
[wpv-control-postmeta field="wpcf-yourfieldslug" format="%%NAME%% (%%COUNT%%)" url_param="wpv-wpcf-yourfieldslug"]
See our Views Shortcode reference: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-520693
Then you can add this View to your Content Template
More information here: https://toolset.com/documentation/getting-started-with-toolset/filter-content-lists-and-add-custom-search/
Let me know if this helps you or if you need further assistance.