WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

WP Boilerplate Shortcode

Provides a shortcode that when inserted will display the body from a referenced "boilerplate" post type.

Where do add/edit my boilerplates?

Look on the left sidebar in your WordPress admin after you've activated the plugin for a menu called "Boilerplates."

Can you give me examples of using the shortcode?

Sure. Here are some simple examples:

  •  [boilerplate bytitle="Payment Terms"]
  •  [boilerplate bypath="copyright"]
  •  [boilerplate byid="971"]

Here are some more complex examples:

  •  [boilerplate bytitle="Payment Terms" showtitle="true" title="Terms for Payment" titletag="strong" id="terms"]
  •  [boilerplate bypath="copyright" class="boilerplate copyright"]

Where do I type the shortcode?

Type the shortcode into the body of any page, of any post, or of any custom post type where you want the boilerplate processed.

Does this plugin provide a boilerplate template tag?

Yes:

  1. the_boilerplate('contact-methods'); // 'contact-methods' = the path of the boilerplate.
  2. the_boilerplate('Contact Methods','title'); // 'Contact Methods' = the title of the boilerplate.
  3. the_boilerplate(123,'id',array('showtitle'=>'true')); // 123 = boilerplate's post ID.

The array parameter in example #3 can contain any of these attributes

After Adding/Editing a Boilerplate if I click "View" I get an error. Why?

If you are still getting this error it's because WordPress still hasn't addressed this problem.

We decided to disallow boilerplates to be seen directly via a URL and as such when you try to view them WordPress tell you you cannot see it.

An example URL that you might see (assuming you were on the domain example.com and had a boilerplate called "Copyright") might be as follows:

 http://example.com/boilerplates/copyright/

This URL will not work because boilerplates do not get a page of their own.

Hopefully WordPress will address this soon and you'll be able to view your boilerplates from within the admin console.

What's the syntax for the shortcode/template tag?

If you are into things from a technical persective it looks like this (angles <> indicate placeholders, a vertical bar | indicates "or", elipsees indicate one or more, parens indicate grouping, and braces {} indicate optional):

  • Shortcode:

    [boilerplate (bytitle|bypath|byid)="(||)"
       {showtitle="(true|false)"} {title=""} {titletag=""}
       {id=""} {class="}]

For the template tag the parens are not needed for grouping and the square brackets indicate optional, which is what most docs use for optional, when it doesn't conflict with actual syntax:

  • Template Tag:

    the_boilerplate(|| [, 'path'|'title'|'id']
       [, array(['showtitle'=> 'true'|false',] ['title' => '',]
       ['titletag' => '',] ['id' => '',] ['class' => '',] ));

Requires: 3.0 or higher
Compatible up to: 3.0.5
Last Updated: 2010-3-29
Downloads: 673

Ratings

3 stars
3.5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,3,3
100,1,1
100,1,1