Insert a blog post list using the blog shortcode. Add the shortcode to a page or other content area to produce a list of blog posts. Optional parameters allow customization of the display.
[hr]
[blog category=”10″ style=”1″ posts_per_page=”1″ paging=”false” image_width=”280″ image_height=”180″ excerpt_length=”40″ read_more=”read more” show_category_list=”false” orderby=”rand”]
[clear]
Example shortcode:
[code][blog category=”1″ style=”1″ posts_per_page=”5″ paging=”false” image_width=”280″ image_height=”180″ excerpt_length=”60″ read_more=”read more” show_category_list=”false” orderby=”rand”][/code]
[hr]
[four_fifth] [blog category=”10″ posts_per_page=”1″ paging=”false” image_width=”514″ image_height=”200″ excerpt_length=”50″ read_more=”read more” show_category_list=”false” orderby=”rand”] [/four_fifth]
[clear]
Example shortcode:
[code][blog category=”1″ posts_per_page=”5″ paging=”false” image_width=”415″ image_height=”200″ excerpt_length=”35″ read_more=”read more” orderby=”rand”][/code]
[hr]
[code][blog category=”7,8,9″][/code]
[clear]
[clear]
Posts from categories with paging and post details:
[blog category="7,8,9" author_avatar="true" show_date="true" paging="true"]
Posts from categories, full post no images:
[blog category="7,8,9" post_content="full" images="false"]
[hr]
Blogs may also be generated from pages using a list of page ID’s or the child pages from a parent page ID.
[clear]
[clear]
Pages from list of page ID’s:
[blog post_type="page" page_id="10,11,12"]
Child pages from parent page ID:
[blog post_type="page" post_parent="9"]
[hr]
[clear]
Display random posts:
[blog category="8" orderby="rand"]
Display popular posts:
[blog category="8" orderby="comment_count"]
[hr]
For advanced usage, you can add most parameters accepted by WP_Query . The shortcode can use any of these parameters which are string or an integer values. Arrays are not supported.
Example use of WP_Query s
parameter used to return a query filtered by a search term.
[clear]
Display posts based on search results:
[blog category="8" s="Lorem Ipsum"]
[clear]
Display all posts except those from a category by prefixing its id with a ‘-‘ (minus) sign:
[blog cat="-8"]
[clear]