How to display WordPress custom post types, fields and taxonomies on the front end
Once you have used the free Easy Post Types and Fields plugin to create custom post types, fields and taxonomies, you might want to display them on the front end of your website. There are several ways to do this.
If you want to display documents or WooCommerce products, skip ahead.
WordPress automatically creates a front end post and category pages for each of your custom post types and taxonomies. This will display the standard fields for the post type in the same format as the blog, which comes from your theme. It won't display custom fields or taxonomies.
The default display is fine if you are creating blog-like content and don't want to display custom fields or taxonomies directly on the page. Otherwise, we recommend using one of the other methods described below.
List the information in a table
The easiest way to display your custom post types, fields and taxonomies is to list them in a searchable table using the Posts Table Pro plugin. This is our flagship WordPress table plugin, and it is the perfect way to display any type of data from your website.
Posts Table Pro lists your custom post types in a searchable, sortable table with filters. Each post has its own row in the table. Users can search and filter the table to quickly find what they're looking for.
You can display your custom fields as columns in the table. That way, users can see the custom field data for each post, and search and sort by custom field.
There are several ways to display taxonomies in Posts Table Pro:
- Include taxonomy columns in the table. The taxonomy terms for each post are displayed in a comma separated list. Users can click on them to filter the table by that term.
- List taxonomies in filter dropdowns above the table. For example, if you have added a 'Year' taxonomy to a 'Resource' custom post type then you can list all the years in a dropdown above the table. Users can select a year to view all resources which are tagged with that year.
The Easy Post Types and Fields plugin is developer-friendly. It contains all the hooks and filters that you need in order to display the custom post type data, custom fields and taxonomies programmatically.
For full details, please see the developer documentation.
Displaying documents and WooCommerce products
The above information focusses on the Posts Table Pro plugin because you can use that to list any post type in a table. However, there are dedicated plugins which are better at listing either documents or WooCommerce products. They
- Displaying downloadable documents - Use the Document Library Pro plugin to display documents and other types of resource, complete with preview links and download buttons. With this option, the plugin creates a post type for you so you don't need to worry about that. You can use Easy Post Types and Fields to add custom fields and taxonomies to the documents post type.
- Displaying WooCommerce products - Use the WooCommerce Product Table plugin to display WooCommerce products which you have added extra custom fields and taxonomies to.
Both of these plugins work very similarly to Posts Table Pro in terms of displaying your custom data in a searchable table. However, they have extra features which are better for displaying documents or products.