Listing Custom Post Type Entries with a Short Code
Once you have created a custom post type with Easy Content Types, you will want to begin displaying entries from that post type. There are a variety of ways to do it, but one of the easiest by far is using the [ecpt_query] short code included with the plugin. This short code will let you display a list of posts from any post type (including the default posts and pages). It will also let you limit the items displayed, to those filed in a particular taxonomy, or even a particular term within that taxonomy.
The short code, and all of its parameters (with default values) looks like this:
|[ecpt_query post_type="post" tax="" terms="" number="5"]|
|[ecpt_query post_type="books" number="8"]|
|[ecpt_query post_type="post" tax="genre" terms="fantasy" number="4"]|
|[ecpt_query post_type="post" tax="genre" terms="fantasy,science-fiction" number="4"]|
Notice that the genre names (they’re called Terms) are lower-cased and have spaces replaced with hyphens. This is because we have to use the Term Slug. The slug is the url friendly name of the term. You can find the slug of your term by going to the custom Taxonomy page (in this case, Genres) underneath the main menu item for the post type the taxonomy is attached to, and looking in the “slug” column.
That’s it. Pretty easy.