This plugin shows posts from a category on any page you like using shortcodes. Create multiple blogs within a blog using a category. Hode posts in a s
How to install the plugin and get it working.
blog-in-blogdirectory to the
/wp-content/plugins/directory (or install via wordpress plugins admin menu)
[blog_in_blog category_slug='my-category-slug' num=5]to a new PAGE (not post) on your site.
NOTE: Don't copy any code from here and paste into the visual editor, as you will be copying some HTML too, and you may not want that. Use the HTML editor to paste you shortcode and make sure it is not wrapped in extra HTML.
Add the shortcode in the body of a new PAGE (not post) to select a number of posts within a specified category. This page with the shortcode becomes your 'blog in blog' page (you can of course call it what you will). i.e:
[blog_in_blog category_slug='my-category-slug' num=10]
Yuo must specify the
category_slug . Optionally specify a number of posts, defaults to 10. There are lots of other parameters you can use (see below).
You can hide the pagination of the posts.
[blog_in_blog category_slug='my-category-slug' num=10 pagination=off]
You can optionally specify a template to use for an instance of the blog-in-blog shortcode.
[blog_in_blog category_slug='my-category-slug' num=5 template="myfile.tpl"]
This template must exist in the
wp-content/uploads directory or the
wp-content/uploads/(or wherever you have set your uploads folder) for your template file first before looking in
wp-content/plugins/blog-in-blog(your template will probably be lost when the plugin is upgraded).
NOTE: Don't copy any code from here and paste into the visual editor, as you may be copying some HTML too, and you may not want that. Use the HTML editor to paste you shortcode and make sure it is not wrapped in extra HTML.
As a minimum you need the following shortcode:
or to save you typing
[blog_in_blog] every time...
All shortcode paramaters:
These shortcode parameters can be combined in any way you like (except
post_id) to target specific posts:
category_id=<integer>The ID of the category you wish to show
category_slug=<category_slug>The slug of the category you wish to show
custom_post_type=<post_type>Posts with a custom post type that you want to show
tag_slug=<tag_slug>Posts of this tag slug will be shown. You can do OR (slug1,slug2,slug3) and AND (slug1+slug2+slug3)
author=<author id>Posts from this author, identified by a numeric author id.
author_name=<author user_nicename>Posts from this author, identified by their user nicename.
post_id=<a post id>If specified only shows a single post. All other selection or sort parameters are ignored.
These parameters affect the pagination display:
num=<integer>Number of posts per page. Defaults to 10 if not set
pagination=<on or off>Defaults to on.
These parameters affect the order of the posts:
order_by=<a valid option>Defaults to date. Valid options are those supported by Template Tag query_posts() so things like date, title, rand (for random). Overidden by
custom_order_by=<custom field>Name a custom field to order by. If the field contains dates, they must be entered
YYYY-MM-DDor sorting by date will not work. If you want the dates to show in the template and be formated, you can select the custom field to be formatted using the default date format in WordPress. If set, overides
sort=<sort direction>Sort (the direction to sort the order by field) can be one of the following values (brackets show direction):
These parameters affect the look of your posts.
template=<template_name>Specify a template name. First we assume that this is a named template in the database. Then we look for a file in the following locations, in the order shown:
WP_CONTENT_DIR/uploads/<your filename>(or whever your uploads directory is)
thumbnail_size=<size>For use with `%post_thumbnail% template tag. Where is one of:
%post_title%- The title of the post.
%post_permalink%- The post permalink.
%post_id%- The post id.
%post_author%- The post author.
%post_author_avatar%- The post author's avatar (uses wordpress avatar functionality).
%post_categories%- The categories that the post belongs to.
%post_content%- The content of the post.
%post_excerpt%- The excerpt of the post. Either the excerpt if specifically defined or the
<!--more-->tag in your content, or the default wordpress excerpt, in that order.
%post_comments%- A comments link.
%post_thumbnail%- The thumbnail of the wordpress featured image for the post. Will supply a full
%post_tags%- A list of tags assigned to the post. Will have a link to the wordpress tag space for your site. Delimited by the text delimiter in your blog-in-blog options.
%post_date%- The date of the post as defined by the format string in the admin page.
%post_day%- The day of the month as 2 digits, i.e.
%post_dw%- The day of the week short, i.e.
%post_dow%- The day of the week long, i.e.
%post_mon%- The month short, i.e.
%post_month%- The month long, i.e.
%post_m%- The month numeric leading zero, i.e.
%post_n%- The month numeric, i.e.
%post_year%- The year in 4 digits, i.e.
%post_yr%- The year in 2 digits, i.e.
%...%- All custom fields attached to a post can be used in the template. Simply place your custom field name between percent (%) marks,
Requires: 3.0 or higher
Compatible up to: 3.3.2
Last Updated: 2012-3-3
0 of 2 support threads in the last two months have been resolved.
Got something to say? Need help?