Shortcodes

Shortcodes are little bits of text you put in a post or page that do wonderful things. Shortcodes were introduced to WordPress in version 2.5, and bSuite adds a few to make managing content easier.

Note: the token API of bSuite 3 has been deprecated in favor of shortcodes. bSuite 3 tokens will work in bSuite 4, but they likely won’t be supported in later versions of bSuite.

Feed

Usage example:
[feed feed_url="http://path.to.com/the/feed" div_class="my_css_class_name" count="3"]

Defaults:

array(
	'title' => FALSE,
	'div_class' => FALSE,
	'ul_class' => 'feed',
	'ol_class' => FALSE,
	'feed_url' => FALSE,
	'count' => 5,
	'template' => '
	<li>
<h4 id="12141_title_1" ><a href="%%link%%">%%title%%</a></h4>
%%content%%</li>
',
)

Include

Sometimes it makes sense include the content of one or more pages in another page. That’s what this shortcode does. Just give it a page/post ID or URL to the page/post you want to include.

Usage example:
[include] or [include post_id="27" field="post_content"]

Defaults:

array(
	'post_id' => FALSE,
	'url' => FALSE,
	'field' => 'post_excerpt',
)

Innerindex

Inserts an ordered list of headings in the current page, with anchored links to make it easy to jump to those sections of the content. The list is generated automatically from any tags in your post or page content.

Usage example:
[innerindex] or [innerindex title="Jump to section:" div_class="my_css_class_name"]

Defaults:

array(
	'title' => 'Contents',
	'div_class' => 'contents innerindex',
)

List_pages

This shorcode inserts a list of child pages into the page content as either a ordered or unordered list. Works similarly to wp_list_pages(), but the shortcode can be inserted anywhere into any page’s content.

Usage example:
[list_pages] or [list_pages depth="2" div_class="my_css_class_name"]

Defaults:

array(
	'title' => 'Contents',
	'div_class' => 'contents pagemenu',
	'ul_class' => 'contents pagemenu',
	'ol_class' => FALSE,
	'excerpt' => FALSE,
	'child_of' => {current page id},
	'depth' => 1,
	'sort_column' => 'menu_order, post_title',
	'show_date'   => '',
	'date_format' => get_option('date_format'),
	'exclude'     => '',
	'authors'     => '',
)

5 thoughts on “Shortcodes

  1. Pingback: » Do WordPress Pages Better With bSuite MaisonBisson.com

  2. How would I place the most popular posts generated by BSuite outside of a widget? I would like to be able to have these in a tabbed format of most popular, most comments, and tags.

    How would I accomplish this?

  3. Hi, thanks for the plugin.
    How would you call the innerindex function itself, so you can add it to a template (so you do not have to add it to every post manualy)?

    I think it should be something like , but am not sure about the details, as this does not work ;)

    Thanks,
    Cheers,
    Harry

  4. hmm, php got stripped, not sure if I can try again:

    I think it should be something like
    if (function_exists(‘shortcode_innerindex’)) { shortcode_innerindex( $arg ); } , but am not sure about the details, as this does not work ;)

    Thanks,
    Cheers,
    Harry

  5. I wonder if you realize that Bsuite is the only widget that out of the box will happily display all subpages with excerpts?

    This alone makes it a significant plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>