I really needed a way to show summarised posts by for a particular category or set of tags under the heading of a single page and could not find a suitable plugin, so I decided to write one.
If you go to the page link “ASP.Net” in the header of this site you will see snipped posts from the category ASP.Net. If you click on “HTML/CSS/jQuery” what you see is summarised versions of the posts tagged with either ‘HTML’, ‘CSS’ or ‘jQuery’.
How to use the plugin:
- Create a new page. Switch to HTML view.
- Insert the shortcode: [posts-for-page cat_slug='asp-net-programming-2']
- This option will show a summary (defaulted to 50 words) of all posts in the category with this slug
- cat_slug – Show all posts with this category slug
- cat – Show all posts with a particular category ID
- tag_slug – Show all posts with a specific tag (more than one can be entered – comma separated, i.e. tag_slug=’html,css’ (note: no spaces)
- order_by – Order the posts by ‘date’ or ‘title’
- post_id – Show one post
- author – Show posts by author (supply author id)
- num – Limit the number of posts to show
- hide_images (true/false) – If images are a problem they can be hidden using: hide_images=’true’
- Added in V1.5 (Pagination if number of posts is specified e.g. num=’x’)
- read_more – Replace default read more text (i.e. read_more=’Show me more…’)
- prev_text – Replace default Previous entry link text when specifying number of posts (i.e. prev_text=’Newer’)
- next_text – Replace default Next entry link text when specifying number of posts (i.e. next_text=’Older’)
- show_full_posts(true/false) – Show full post rather than excerpt (i.e. show_full_posts=’true’)
- Added in v1.6
- use_wp_excerpt – set to ‘true’ to show the WP generated excerpt or the excerpt if defined for the post
- strip_html : set to ‘true’ attempts to strip all HTML content (if not using use_wp_excerpt option)
- hide_post_content : set to ‘true’ to only show the post titles
- show_meta : set to ‘true’ to show post date and author name
- hide_post_title : set to ‘true’ to hide the post title, e.g. if you just want to show one post using post_id
- Added in v1.7
- hide_read_more : set to ‘true’ to hide the read more link
- create_para_tags : set to ‘true’ to use the WP ‘wpautop’ function to create <p> tags and <br> tags from line breaks
- order : set to ‘ASC’ or ‘DESC’ – Designates the ascending or descending order of the ‘orderby’ parameter. Defaults to ‘DESC’
- Added in v2.0
- Plugin will now attempt to find an image in the content even if no image attached to post unless hide_images set to true
- Image dimensions can be set using force_image_height, or force_image_width
Note: Each summary posts is contained in a div with class=”pfpItem”, so you can override styles by setting them in the WP stylesheet “styles.css”. E.g.
[posts-for-page cat_slug='asp-net-programming-2' num='5' read_more='
Read More »' use_wp_excerpt='true' show_meta='true' force_image_width='150']
- Grab the plugin files:
- Unzip and copy the files to your WordPress wp-content/plugins folder.
- Goto your admin plugins page and activate it.
- The follow the instructions above for usage.
If its helped you out maybe you could:
You can also find the plugin on the Official WordPress Plugins Site.
If you want to contribute to the code it is hosted on github: https://github.com/shibbard/posts-for-page.