How to List a Custom Post Type such as Portfolio, Events or Products in Posts Table Pro
The Posts Table Pro WordPress table plugin can be used to list posts from any custom post type. This includes portfolios, case studies, testimonials, e-commerce plugins, events, and much more.
Creating a custom post type
For step-by-step instructions on how to add a custom post type to WordPress, please read our tutorial or watch the video:
Displaying custom posts
Posts Table Pro can show all the standard information about your custom posts, including the featured image and information such as the title and content. It can also display extra data such as custom fields and taxonomies.
There are two ways to tell Posts Table Pro which post type to display:
- Go to the Posts Table Pro settings page at Settings → Posts Table Pro.
- Select the custom post type from the 'Post type' dropdown.
This will set the default post type which is used in all the tables that you create using Posts Table Pro. If you want to list different post types in different tables, then you can use the shortcode method (below).
As well as selecting the post type globally on the Posts Table Pro settings page, you can set the post type directly in the shortcode. This method allows you to list items from a different custom post type in each table on your site. For example, it's useful if you want to create one table listing case studies, and another listing publications.
To do this, you need to know the name/slug of the custom post type. You can find this by clicking on the link for the custom post type (e.g. 'Portfolio') on the left of the WordPress admin. Next, look at the URL at the top of your browser window. It will look something like this:
Instead of the word 'portfolio' in red, you'll see the name of your custom post type.
Once you know that, use these instructions to create a table listing your custom posts. For example, your Posts Table Pro shortcode might look something like this: