List Posts and/or Pages by ID
This plugin is designed to list any posts or pages by any taxonomy (category or tag) or post/page ID number.
List Specific Posts by ID Number:
By default no matter what blog a post is created all ID numbers will be unique. That is if you make to pages with the same title and slug on different blogs the ID numbers will be different. So you will need the ID number of each post you want to include. Here is a simplified version of the shortcode.
As you can see from the list above it shows three different post from two different blogs. Since no blogs were specified from the shortcode it will default to all blogs.
If you wanted to show pages the shortcode would have to be modified to the following:
==== List of Pages Should Have Shown Here ====
Notice it still uses the attribute – include_post= . That’s because WordPress lists posts and pages equally when referencing by ID number. If you go to your page or post edit screen you will see something similar to the following:
Notice how it says “post=”. This is a listing of a page but it still used the post= id number identifier. That’s why you use include_post= for all post or pages to include in listing.
The above is important because a lot of people use the wrong post_type format and want to know why their posts or pages aren’t listed.
You may also list posts and pages in a single shortcode attribute by doing the following:
Look above and notice I have only included 5 posts but 6 are shown. That’s because the WP eStore Plugin automatically created a page called “Store Action” and assigned it ID number 10. The post “My New Novel Updates” also has a post ID of 10. This is an anomaly and sometimes happens when a plugin automatically creates a post or page. If I had post_type=”page” or just post_type=”post” you wouldn’t notice it because it will list one or the other. Since I used post_type=”post,page” it shows both. The only way to correct this is to delete one or the other and recreate it.
The “Store Action” page is the one I want hidden so to make things easy I will delete and create that one again. Let’s see if that works by looking below:
The “Store Action” page is no longer shown because after deleting and creating it again WordPress assigned it ID number 39. This is the only way to correct anomalies. So if you see a post or page that you didn’t mean to include you know it just has the same ID number and you must delete and re-create one or the other. 🙂
Note: The exclude and include arguments are not to be used at the same time. If they are the plugin gives priority to the include_post=””.