Aspen Shortcodes and Widgets Plugin Documentation -- Version 1.0
Table of Contents
- Plugin Summary
- Aspen Shortcodes Admin Page
- Shortcode Summary
- [aspen_slider] - Flexible, responsive slider
- [aspen_show_posts] Shortcode
- [aspen_tab_group] - content in tabs
- [aspen_header_image] Shortcode
- [aspen_html]
- [div]text[/div]
- iframe - [aspen_iframe]
- [aspen_show_if_mobile] / [aspen_hide_if_mobile]
- [aspen_show_if_logged_in] / [aspen_hide_if_logged_in]
- [aspen_site_title], [aspen_site_desc]
- [aspen_bloginfo arg='name' style='your css']
- Video - [aspen_vimeo], [aspen_youtube]
- Widget Summary
Plugin Summary
The Aspen Shortcodes and Widgets Plugin provides a collection of shortcodes to allow you to easily add extra content and features to your regular content. These shortcodes will work with almost any WordPress theme. Some of the shortcodes (e.g., [aspen_show_posts]) have some optimizations to work with the Aspen Theme and the Aspen S&W theme.
While these shortcodes should prove useful with most any theme, one of the goals of these shortcodes is to provide an alternative to users of the Aspen S&W theme. This plugin supports most Weaver II shortcodes (but not Weaver II Pro shortcodes), allowing for a smooth transition from Weaver II to other themes.
Importat Note about Shortcode Names
In this documentation, all the shortcodes are described using the [aspen_xxxx] name of the shortcode. Using the [aspen_] prefix will help to be sure there are no conflicts with other, similar shortcodes. If you wish, you can check the "Use generic names" option on the OPTIONS tab, and all the shortcodes will respond to just the main part of the name - [show_posts] instead of [aspen_show_posts].
And for Weaver II compatibilitty, all the shortcodes have an equivalent [weaver_xxx] form.
Aspen Shortcodes Admin Page
This plugin has just a few options, all found on the Aspen Shortcodes admin page under the WordPress dashboard Appearance section.
OPTIONS - general options
- Generic Shortcode Names - Enable "generic" shortcode names - e.g., [slider] instead of [aspen_slider]. Note that the generic names are more likely to conflict with other plugins.
Slider - options for the Slider
- Support Videos in Sliders - Enable videos in sliders. Will use an additional script to make videos fit the slider, and responsively resize. This auto-resize script will apply to all videos on pages with sliders. You will get best results using the embed code provided by the video host (e.g., YouTube, Vimeo). If you use [aspen_youtube] or [aspen_vimeo], you must specify a width (e.g., w=940) to allow this feature to work. IMPORTANT: Be sure to specify "video=true" for the [aspen_slider] shortcode. If you have checked Use FitVids Script for Videos on the Videos tab, then you do not need to add "video=true" to [aspen_slider].
- Use Alternate Easing Animation - If you use the useCSS=false option, you need to check this option to load the proper easing animation script. See the bxSlider website for details.
Video - options for Videos
- Use FitVids Script for Videos - Use alternative "FitVids" script for responsive display of all videos. This script will work for any YouTube or Vimeo video - even if not specified by this shortcode. If checked, [aspen_youtube] and [aspen_vimeo] will automatically use a "w=nnn" option, and ignore the "percent" option. Note: if you use [aspen_youtube] and [aspen_vimeo] for all your videos, then you will have better appearance if you do not check this option.
Shortcode Summary
[aspen_slider] - Flexible, responsive slider
The Aspen [aspen_slider] shortcode is based on the bxSlider jQuery slider script. This elegant and powerful tool allows you to generate sliders of almost any size, with any content - images, videos, even arbitrary HTML. While it is easy to use the associated Aspen S&W shortcodes, you can also use native HTML as shown in the examples on the bxSlider site.
Aspen Slider Shortcodes
The plugin provides several shortcodes to enable you to build a slider:
- [aspen_slider id=slider-id noborder=false css="css" style=css-style bxSlider-Options...]slides[/aspen_slider]
This creates each slider set you define. The id is used to define an id for the slider. If not supplied, one will be generated. If you use this slider with a slider pager, you must then specify both the id and the corresponding pagerCustom value.
If you add noborder=true, then the slider will not have a border.
The css option lets you specify css for this slider. This must be complete CSS rules (e.g., css="#myslider {margin-left:20px!;}"), and will require knowledge of the classes and divs of the generated slider. Each slider is also wrapped with the .atw-slider class. Any CSS provide will be added as an internal <style>css rules</style> block. This is an advanced option, and is not commonly needed. It is most useful to override the default bxSlider theme CSS.
The style option lets you specify inline CSS style rules. These will be added to a div that wraps the entire slider:<div style="your-css-style"><ul id="slider-id">slides...</ul></div>. This could be used to add padding around the entire slider, for example.
The bxSlider-Options can be any of the supported bxSlider options, described below, and on the bxSlider Options page.
Between the open and close aspen_slider tags, you define the separate slides, usually with the [aspen_slide] shortcode.
You can also define an associated pager using the [aspen_slider_pager] shortcode.
Technical note: The [aspen_slider] shortcode first generates the appropriate jQuery script used to interface with the jQuery based bxSlider library. It then wraps all the slides inside a <ul>...</ul> pair, just like the examples on the bxSlider website. Using [aspen_slider] also causes the bxSlider to be loaded at the appropriate place on the page. Using [aspen_slide], [aspen_slider_pager], and [aspen_pager_index] all generate the equivalent HTML code found in the bxSlider examples. The [aspen_slider_options] can be used to in conjunction with regular HTML code to generate the corresponding jQuery bxSlider script.
- [aspen_slide]slide html definition[/aspen_slide]
This is used to define the contents of the slider. You can specify any HTML you need here. All slides of a single slider are defined between the opening [aspen_slider] and closing [/aspen_slider].
For images, you will need to specify <img href="full-url-to-image" />. The slider will size based on the largest sized slide. If you want a slider with everything filled in, you should make sure all the images are the same size. They will then be responsively displayed depending on the screen size.
You can use any arbitrary HTML, including text. One possibility is to use the [aspen_show_posts] code to build a slider of recent posts.
This shortcode wraps the slide with <li> and </li>, just like the the bxSlider example.
- [aspen_slider_pager id=slider-id pagerCustom=pager-id]index-thumbs[/aspen_slider_pager]
This is used to define a pager associated with a slider. It should be placed immediately after the corresponding slider is defined. You must specify both the id of the associated slider, and give an id for this pager in the pagerCustom field, including the leading #. You also need to provide the pagerCustom id in the corresponding [aspen_slider] shortcode.
- [aspen_pager_index]index-thumbnail[/aspen_pager_index]
Define the corresponding index thumbnail (or simple text) associated with each slider. These must correspond to the exact order of the associated slider.
This shortcode generates the appropriate <a> link code as required by bxSlider.
- [aspen_slider_options id=slider-id css="css" bxSlider-Options...]
The purpose of this shortcode is to allow you to define your sliders using standard html <ul> and <li> groups as found in all the bxSlider examples. Add the id provided with this shortcode to the <ul> around the slider (e.g., <ul id="slider-id"> ... <li>slide...</li></ul>) definitions. This shortcode will generate the appropriate jQuery bxSlider code, and load the bxSlider script. The css option is the same as described for [aspen_slider].
Examples
Basic Example
This example uses the header images included with the Apsen theme. (If you are using aspen, you can copy/paste the example to see a working slider.)
[aspen_slider id=bxslider]
[aspen_slide]<img alt="" src="/wp-content/themes/aspen/images/headers/maroon-bells.jpg" />
[/aspen_slide]
[aspen_slide]<img alt="" src="/wp-content/themes/aspen/images/headers/mountain-stream.jpg" />
[/aspen_slide]
[aspen_slide]<img alt="" src="/wp-content/themes/aspen/images/headers/mum.jpg" />[/aspen_slide]
[aspen_slide]<img alt="" src="/wp-content/themes/aspen/images/headers/sopris.jpg" />[/aspen_slide]
[/aspen_slider]
Pager Example
[aspen_slider id=bxslider-pg pagerCustom=#pager]
[aspen_slide]<img alt=""
src="/wp-content/themes/aspen/images/headers/maroon-bells.jpg" />[/aspen_slide]
[aspen_slide]<img alt=""
src="/wp-content/themes/aspen/images/headers/mountain-stream.jpg" />[/aspen_slide]
[aspen_slide]<img alt=""
src="/wp-content/themes/aspen/images/headers/mum.jpg" />[/aspen_slide]
[aspen_slide]<img alt=""
src="/wp-content/themes/aspen/images/headers/sopris.jpg" />[/aspen_slide]
[/aspen_slider][aspen_slider_pager id=bxslider-pg pagerCustom=#pager]
[aspen_slider_index]<img alt=""
src="/wp-content/themes/aspen/images/headers/maroon-bells-thumbnail.jpg" />[/aspen_slider_index]
[aspen_slider_index]<img alt=""
src="/wp-content/themes/aspen/images/headers/mountain-stream-thumbnail.jpg" />[/aspen_slider_index]
[aspen_slider_index]<img alt=""
src="/wp-content/themes/aspen/images/headers/mum-thumbnail.jpg" />[/aspen_slider_index]
[aspen_slider_index]<img alt=""
src="/wp-content/themes/aspen/images/headers/sopris-thumbnail.jpg" />[/aspen_slider_index]
[/aspen_slider_pager]
Eliminate Pager Dots
You can eliminate the row of pager dots below the slider by adding pager=false to the parameter list on [aspen_slider] or [aspen_slider_options].
Eliminate Previous and Next buttons
You can eliminate the left and right arrow buttons on a slider by adding nextSelector=#none1 and nextSelector=#none2 to the parameter list on [aspen_slider] or [aspen_slider_options]. There are other things you can do with the previous and next links described on the bxSlider site.
Example using [aspen_slider_options] and HTML
You can use straight HTML for your sliders as used in the examples on the bxSlider site by using the [aspen_slider_options] shortcode to setup the required jQuery bxSlider scripts. The above simple example can equivalently be generated like this:
[aspen_slider_options id=bxslider css="#bxslider{margin:0;}"]
<ul id="bxslider">
<li><img alt="" src="/wp-content/themes/aspen/images/headers/maroon-bells.jpg" /></li>
<li><img alt="" src="/wp-content/themes/aspen/images/headers/mountain-stream.jpg" /></li>
<li><img alt="" src="/wp-content/themes/aspen/images/headers/mum.jpg" /></li>
<li><img alt="" src="/wp-content/themes/aspen/images/headers/sopris.jpg" /></li>
</ul>
Note: because of a quirk with WP site structure, you need to add the css="#bxslider{margin:0;}" as an option with many themes.
Example full width Header slideshow with auto play
In Aspen and Weaver II, you can make a slideshow in the Header area by adding an [aspen_slider] shortcode to the Site Header Insert Code or Pre-Header code areas. (Other themes may allow you to add shortcode to the header area, but it is uncommon.) This is an example of just the opening [aspen_slider] to do that:
[aspen_slider id=headerslider noborder=true pager=false nextSelector='#none1' prevSelector='#none2' mode=fade auto=true randomStart=true]
bxSlider Options
The following options are supported as paramaters to [aspen_slider] and [aspen_slider_options]. They are more completely described at bxSlider.com.
Technical note: To use any of these options, add them to either the [aspen_slider] or [aspen_slider_options] shortcodes. They will be then used to generate the appropriate $('#slider-id').bxSlider({options:value}); code used to invoke the bxSlider script for each slider. When used with the [aspen_slider] shortcode, you should use the corresponding [aspen_slide] shortcodes. If used with the [aspen_slider_options] shortcode, you can then use the <ul> and <li> slider code as found in the bxSlider examples.
GENERAL- mode - horizontal, vertical, or fade (default: horizontal)
- speed - slide transition duration (ms) (default: 500)
- slideMargin - Margin between each slide (default: 0)
- startSlide - Starting slide index (zero-based, default: 0)
- randomStart - Start slider on a random slide (true/false) (default: false)
- infiniteLoop - If true, clicking "Next" while on the last slide will transition to the first slide and vice-versa (default: true)
- hideControlOnEnd - If true, "Next" control will be hidden on last slide and vice-versa. Note: Only used when infiniteLoop: false
- easing - The type of "easing" to use during transitions. Options when useCSS=true: 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'cubic-bezier(n,n,n,n)' (default: linear) Options when useCSS=false: 'swing', 'linear' - see the bxSlider options page for more.
- captions - Include image captions. Captions are derived from the image's title attribute (true/false) (default: false)
- ticker - Use slider in ticker mode (similar to a news ticker) (true/false) (default: false)
- tickerHover - Ticker will pause when mouse hovers over slider. Note: this functionality does NOT work if using CSS transitions - set useCSS=false and check "Use Alternate Easing Animation" option on the Slider options admin page.
- adaptiveHeight - Dynamically adjust slider height based on each slide's height (true/false) (default: false)
- adaptiveHeightSpeed - Slide height transition duration (in ms). Note: only used if adaptiveHeight: true
- video - If any slides contain video, set this to true. (true/false) (default: false) See http://fitvidsjs.com/ for more info
- useCSS - If true, CSS transitions will be used for horizontal and vertical slide animations (this uses native hardware acceleration). If false, jQuery animate() will be used. Note: you must also check the "Use Alternate Easing Animation" option on the Slider options admin page.
- preloadImages - If 'all', preloads all images before starting the slider. If 'visible', preloads only images in the initially visible slides before starting the slider (tip: use 'visible' if all slides are identical dimensions) (default: visible)
- pager - If true, a pager will be added (true/false)
- pagerCustom - ID of associated pager - include leading #, MUST be in both slider and pager
- pagerType - If 'full', a pager link will be generated for each slide. If 'short', a x / y pager will be used (ex. 1 / 5) (default: full)
- pagerShortSeparator - If pagerType: 'short', pager will use this value as the separating character (default: ' / ')
- controls - If true, "Next" / "Prev" controls will be added (true/false) (default: true)
- nextSelector - next selector id
- prevSelector - prev selector id
- nextText - Text to be used for the "Next" control (default: 'Next')
- prevText - Text to be used for the "Prev" control (default: 'Prev')
- autoControls - If true, "Start" / "Stop" controls will be added (true/false) (default: false)
- startText - Text to be used for the "Start" control (default: 'Start')
- stopText - Text to be used for the "Stop" control (default: 'Stop')
- autoControlsCombine - When slideshow is playing only "Stop" control is displayed and vice-versa (true/false) (default: false)
- auto - Slides will automatically transition (true/false) (default: false)
- pause - The amount of time (in ms) between each auto transition (default: 4000)
- autoStart - Auto show starts playing on load. If false, slideshow will start when the "Start" control is clicked (true/false) (default: true)
- autoDirection - The direction of auto show slide transitions ('next' or 'prev') (default : 'next')
- autoHover - Auto show will pause when mouse hovers over slider (true/false) (default: false)
- autoDelay - Time (in ms) auto show should wait before starting (default: 0)
- minSlides - The minimum number of slides to be shown. Slides will be sized down if carousel becomes smaller than the original size. (default: 1)
- maxSlides - The maximum number of slides to be shown. Slides will be sized up if carousel becomes larger than the original size. (default: 1)
- moveSlides - The number of slides to move on transition. This value must be >= minSlides, and <= maxSlides. If zero (default), the number of fully-visible slides will be used. (default: 0)
- slideWidth - The width of each slide. This setting is required for all horizontal carousels! (default: 0, recommended: 940)
[aspen_show_posts] Shortcode
The [aspen_show_posts] is a very powerful tool for displaying posts from within your pages or from a text widget. Among other possibilities, it can be used to get a magazine style layout on your pages. This shortcode is intended to display a relatively small number of selected posts. It does not split posts into multiple pages like a blog page does. If you need selective display of many posts, the Page with Post page template is the better choice.
Which posts are displayed are controlled by the filtering options provided as parameters of the shortcode. Below is a summary of all parameters, shown with default values. You don't need to supply every option when you add the [aspen_show_posts] to your own content. There may seem to be an overwhelming set of options for this shortcode, but it gives you many options for displaying specific posts within a static page.
The default global settings for various post display options will be used unless overridden with a value in the shortcode. If there are more posts than 'number' that match the filter, only the first 'number' posts will be displayed. For example, if you had a "news" category, you could set cats="news" and number="1" and display just the most recent news post.
Summary
[aspen_show_posts cats="" tags="" author="" author_id="" single_post="" post_type= "" orderby="date" sort="DESC" number="5" show="full" hide_title="" hide_top_info="" hide_bottom_info="" show_featured_image="" hide_featured_image="" show_avatar="" show_bio="" excerpt_length="" style="" class="" header="" header_style="" header_class="" more_msg="" left=0 right=0 clear=0]
You can enclose the option values in either double or single quotation marks. If there is just one value, you don't need any quotation marks. If you don't include an option, the default value will be used. For most option, the default value is an empty string, which means that option won't be used to filter for posts, or that the global formatting from the Main Options settings will be used.
Important Note: [aspen_show_posts] will work on pages, widget areas, and even from within most posts. The only thing you need to be careful about when using this in a post is to avoid including the current post in posts that would be displayed by the shortcode. For example, don't use the shortcode inside a post that is in "Category A" to display other posts from "Category A". This creates an endless nesting situation (technically, called infinite recursion) that will likely fail with the "white screen of death". But don't worry - that can't happen from regular pages and widget areas, and not from most posts, either. But you can't use it within a post to show "similar" posts from the same category, for example.
Filtering Options
These options are used to filter or select which set of posts are displayed. Default value in {}'s.
- cats - Select posts from a comma separated list of category slugs. Add minus (-) to front of slug to exclude posts from that category.
- tags - Select posts from a comma separated list of tag slugs.
- author - Display posts from a single author. Use the author Username, including any spaces.
- author_id - Display posts from a list of author ids. Use a comma separated list of author ids. Negative value (e.g., -3) will exclude that author. One way to get the author id is to Edit the author/user from the All Users page, and the id will show as user_id=123 in the address bar. There are plugins for this as well.
- single_post - Display single post. Specify slug of post name.
- post_type - Display entries from a single specified custom post type. You will need a separate plugin (e.g., Types - Complete Solution for Custom Fields and Types) to create custom post type content.
- orderby - Sort order used to display posts. Possible values: author | date | title | rand | parent {date}
- sort - Sort order. Possible values: ASC | DESC {DESC}
- number - The number of posts to show {5}. Note that if there are more posts that match the filter you've created, only this number of post will be displayed, and there will be no "Previous" or "Next" link as found on you full blog page unless you also specify 'paged=true'. If you specify 'number=-1', then all posts will be displayed. Note that showing all posts will not automatically page the posts, and this could potentially generate a HUGE page, perhaps even testing the page length limits of a browser.
- paged - If you specify 'paged=true', then 'number' will be used to control how many posts are displayed, and posts will be displayed in paged mode with "previous" and "next", or a numbered paging control displayed. Limitation: paged works correctly only if you have just one instance of the shortcode on the page. It is also likely there will be unexpected results if you include 'paged' on posts or sidebars.
- nth - Show just the nth post. Why use this? Say you had a slider that can show regular HTML as a slide. You might want to define the first slide as [weaver_show_posts nth=1], the second as [weaver_show_posts nth=2], and so on. Then say you put 5 posts in the slider. (All defined in a Page with Posts). Then you can specify 5 for "Hide first n posts" for in the Page with Posts per page option. So you have the first 5 posts in a slider, while the remainder show normally on the Page with Posts.
Formatting Options
These options control how posts displayed by [aspen_show_posts] are formatted, and which parts of a post are displayed. These options will override any other settings for posts. If you don't set a particular option, then the formatting will be controlled first by any per post settings, then by any options specified in the Main Options admin tab.- show - Display posts by title, excerpt, full post, title plus featured image, or a list of title links. The titlelist option will produce a simple unorderlist (<ul>) of just the titles (as links) - useful for generating a table of contents. Possible values: title | excerpt | full | titlelist | title_featured
- hide_title - Use value of 1 to hide the post title
- hide_top_info - Hide the top info line (Posted on, by).
- hide_bottom_info - Hide bottom info line (Category, tags, comment link)
- show_featured_image - Force showing post associated featured image.
- show_avatar - Show the author avatar if defined.
- show_bio -Show the author bio below posts.
- excerpt_length - Override excerpt length.
- style - Inline CSS style for .atw-show-posts class. Provide just the rules that would go inside the quotation marks for a standard HTML 'style=' tag (e.g. the option could look like style='border: 1px solid blue;' which would generate <div class="atw-show-posts" style="border: 1px solid blue;">, which would enclose the list of posts in a solid blue border). The point of these style and class options is to allow you to place as many post list on a single static page as you want, each with a different style if needed. This would be great for a Magazine style layout.
- class - Optional class to allow external styling. Adds an additional class name to the .atw-show-posts div, which you could add to the <HEAD> Section option.
- header - Optional header for post. This text will be placed in a <div> above the posts. You could use it to add a "Most Recent News" header for a list of recent new posts, for example.
- header_style - Optional inline style for header. Applies just to the header text.
- header_class - Add a class for the header.
- more_msg - Use this text to replace the standard Continue Reading → message for excerpts.
- left, right, clear - These are used if you want to display the posts in two even columns. You would use at least two [aspen_show_posts] shortcodes. If you specify "left=1", then the posts will be displayed in the left column. If you specify "right=1", then the posts will be displayed in the right column. You can alternate as many instances of the shortcode as you like. However, you also must include "clear=1" in the last shortcode to clear the HTML column information. Otherwise, any content you include after the shortcodes may not display correctly.
Using in a Sidebar
This shortcode has been designed to use in a sidebar using the standard Text widget. There is special CSS styling that reduces the margins on the featured image thumbnail. If you provide the posts you want to show in the sidebar a featured image, you can get quite attractive post excerpts in the sidebar. For example, putting this in a text widget in one of your sidebars:[aspen_show_posts cats='new' show_featured_image='1' show='excerpt' excerpt_length='25' number='2']
will display the latest two posts from the 'news' category. The featured image will be shown in the upper left corner.
CSS styling
The group of posts will be wrapped with a <div> with called .atw-show-posts. You can add a class to that by providing a 'class=classname' option, where you use the name with a period in the CSS in the <HEAD> Section, but just the classname for the [aspen_show_posts] option.
You can also provide inline styling by providing a 'style=value' option where value is whatever styling you need, each terminated with a semi-colon (;).
These CSS rules are pre-defined, but can be overridden using the <HEAD> Section of the Advanced Options tab in Aspen and Weaver II themes, or by a custom CSS plugin such as found in JetPack. The element you're most likely to want to change is the margin-bottom. That determines how much space is added after each post.
.atw-show-posts .hentry {
margin-top: 0px; margin-right: 0px; margin-bottom: 4px; margin-left: 0px;
}
.widget-area .atw-show-posts .hentry {
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
}
.widget-area .atw-show-posts .hentry {
margin-bottom: 0px;
}
.widget-area .atw-show-posts .attachment-thumbnail {
float: left; margin-right: 2px; margin-bottom: 0px; padding: 2px;
}
Example of Two Columns
This example demonstrates how to add two columns of posts on a page. This example will display the first 5 posts in the left column, and the last 5 posts in the right column.
[aspen_show_posts sort="DESC" number="5" left=1] [aspen_show_posts sort="ASC" number="5" right=1 clear=1]
[aspen_tab_group] - content in tabs
Alternative names:[weaver_tab_group], [tab_group]
Show content displayed on tabbed pages.
Shortcode usage:
[aspen_tab_group border_color=black page_min_height=200px]
[aspen_tab title='tab one']This is the content found on first tab.[/aspen_tab]
[aspen_tab title='tab two']And we have more content for the second tab.[/aspen_tab]
[aspen_tab title='last tab']And this is the last tab. There could be more.[/aspen_tab]
[/aspen_tab_group]
Short code parameters
You can supply values for these parameters to control the look of the tabbed section.- border_color: tab and pane border color - default #888
- tab_bg: normal bg color of tab (default #CCC)
- tab_selected_color: color of tab when selected (default #EEE)
- pane_min_height: min height of a pane to help make all even if needed
- pane_bg: bg color of pane
[aspen_header_image] Shortcode
The [aspen_header_image] shortcode allows you display the current header image wherever you want.
For example, you can get the header image into the Header Widget Area by using this shortcode in a text widget.
The current standard or mobile header image will be displayed. Only the <img ... > is displayed --
the image will not be wrapped in a link to the site.
Shortcode usage: [aspen_header_image h='size' w='size' style='inline-style']
- w='size' h='size' - By default, no height or image properties are included with the
header
<img ... >, which will result in an image scaled to fit into whatever the natural width of the enclosing HTML container is (the content area, a text widget, etc.). You may specify an explicit value (usually in px) for the height and width of the image. - style='inline-style-rules' - Allows you to add inline style to wrap output of the shortcode.
Don't include the 'style=' or wrapping quotation marks. Do include a ';' at the end of each rule. The output will look like
style="your-rules;"- using double quotation marks.
[aspen_html]
The Aspen S&W [aspen_html] shortcode allows you to add arbitrary HTML to your post and page content. The
main purpose of this shortcode is to get around the auto paragraph and line break and other HTML stripping functionality
of the WordPress editor.
Shortcode usage: [aspen_html html-tag args='parameters']
- html-tag - The first parameter to the shortcode must be present, and must be a standard
HTML tag -
p,br, orspan, for example. You just supply the tag - no quotation marks, no '=', just the tag. The shortcode provides the < and >. If you need a wrapping HTML tag (e.g.,spanand/span), use two shortcodes:
[aspen_html span args='style="color:red"']content to make red[aspen_html /span] - args='parameters' - Allows you to specify arbitrary parameters for your HTML tag. See the example above.
[div]text[/div]
The Aspen S&W [div] shortcode allows easily add HTML <div> tags to your post and page content. The
main purpose of this shortcode is to get around need to switch to the HTML editor view when you need to
wrap your content in a <div>.
This will work exactly like a standard HMTL <div> tag. It supports 'id', 'class',
and 'style' parameters, which are the most useful. Instead of wrapping your text in <div> tags, wrap them like
this (the Visual view will work just fine):
[div style="font-size:20px;']This content will be large.[/div]
Shortcode usage: [div id='class_id' class='class_name' style='style_values']text[/div]
- id='class_id' class='class_name' style='style_values' - Allows you to specify id, class, and style for the <div>. See the example above.
iframe - [aspen_iframe]
The [aspen_iframe] shortcode allows you easily display the content of an external site. You simply have to specify
the URL for the external site, and optionally a height. This shortcode automatically generates the correct HTML <iframe> code.
Shortcode usage: [aspen_iframe src='http://example.com' height=600 percent=100 style="style"]
- src='http://example.com' - The standard URL for the external site.
- height=600 - Optional height to allocate for the site - in px. Default is 600.
- percent=100 - Optional width specification in per cent. Default is 100%.
- style="style" - Optional style values. Added to <iframe> tag as style="values".
[aspen_show_if_mobile] / [aspen_hide_if_mobile]
The [aspen_show_if_mobile] and [aspen_hide_if_mobile]shortcodes allow you to selectively
display content depending if the visitor is using a standard browser or a mobile device browser. You might want
to disable a video on for mobile devices, for example.
Shortcode usage: [aspen_show_if_mobile type='mobile']content to show[/aspen_show_if_mobile]
You bracket the content you want to selectively display with [aspen_show_if_mobile] or [aspen_hide_if_mobile] and closing
[/aspen_show_if_mobile] or
[/aspen_hide_if_mobile] tags. That content can contain other shortcodes as needed.
The type argument can specify 'mobile' which includes all mobile devices (not tablets), 'touch' which includes
touch sensitive mobile devices (e.g., small screen phones),'smalltablet' for small screen tablets (e.g. Kindle Fire), 'tablet' which includes only tablets such as the iPad,
or 'any' which will include any mobile device. The default is 'mobile'.
[aspen_show_if_logged_in] / [aspen_hide_if_logged_in]
The [aspen_show_if_logged_in] and [aspen_hide_if_logged_in]shortcodes allow you to selectively
display content depending if the visitor is logged in or not.
Shortcode usage: [aspen_show_if_logged_in]content to show[/aspen_show_if_logged_in]
You bracket the content you want to selectively display with [aspen_show_if_logged_in] or [aspen_hide_if_logged_in] and closing tags [/aspen_show_if_logged_in] or
[/aspen_hide_if_logged_in]. That content can contain other shortcodes as needed.
[aspen_site_title], [aspen_site_desc]
The [aspen_site_title] and [aspen_site_desc] shortcodes allow you display the current
site title and site tagline. (The site tagline was formerly called the site description, thus the name of the shortcode.) This can be useful in a text widget in the Header Widget Area, for example.
Note: If you want to position the content of a text widget within the a cell of the Header Widget Area, you could use the following example:
[aspen_site_title style='font-size:150%;position:absolute;padding-left:20px;padding-top:30px;']
Shortcode usage: [aspen_site_title style='inline-style'] [aspen_site_desc style='inline-style']
- style='inline-style-rules' - Allows you to add inline style to wrap output of the shortcode.
Don't include the 'style=' or wrapping quotation marks. Do include a ';' at the end of each rule. The output will look like
style="your-rules;"- using double quotation marks.
[aspen_bloginfo arg='name' style='your css']
This shortcode can be used to access the WordPress function 'get_bloginfo($arg)'. This will return a number of useful strings depending on the value. All the supported values are listed at http://code.wordpress.org/Function_Reference/get_bloginfo. Some useful values include 'stylesheet_directory' and 'template_directory'. You can wrap the bloginfo output with css added to a <span style="your css">.
Video - [aspen_vimeo], [aspen_youtube]
Aspen S&W supports specialized shortcodes to display video. While there are other ways to embed video, the Aspen S&W versions have two important features. First, they will auto adjust to the width of your content, including the mobile view. Second, they use the latest iframe/HTML5 interface provided by YouTube and Vimeo.
Specifying Video Display Size for both shortcodes
Aspen S&W supports a common set of options for both the YouTube and Vimeo shortcodes to support displaying your videos with a specific width and correct height. By default, your videos will be displayed using the full width of the content area being used (percent=100). The percent= parameter is used to specify the width you want.
The height of the video is automatically determined based on the width and the display ratio of the particular video. By default, Aspen S&W will assume a widescreen 9:16 ratio (height is width*0.5625). If you specify 'sd=1', then standard def ratio is assumed (3:4 ratio - height is width*0.75). If you have a custom sized video clip, you may also specify an exact ratio (e.g., 3:9, or ratio=.333). Both Vimeo and YouTube will accept videos with custom ratios, but they must be generated correctly without any letterboxing to display correctly.
Finally, you may specify if the video should be centered or no within the display area using "center=0" to not center (centering is on by default).
Note - if you want to display more than one video horizontally, use "center=0" and specify an appropriate percentage to fit all the videos.
Parameters in Common
- percent=100 - By default, the video will be sized to fill the full content space. You can use the percent value to make the video use a percentage of the content space (but mobile will always use full width).
- ratio=0.5625 - By default, Aspen S&W assumes your video will be a standard 9:16 widescreen video. You can get Standard Def videos by using "sd=1" or "ratio=.075". You can also specify a custom ratio.
- center=1 - Specify 'center=0' to disable centering of the video.
- sd=0 - By default, Aspen S&W will generate sizes for HD/widescreen videos. To display old 4:3 standard definition videos, include 'sd=1' in the shortcode.
- w=640 - By default, the [aspen_vimeo/youtube] shortcode will use the percent value to determine size of the video. A short JavaScript is provided to responsively display videos. You can override the percent and display a fixed size. This is required for proper display in a [aspen_slider], or if you've enabled the FitVids option on the Video tab of the Aspen Shortcodes admin tab.
Vimeo
[aspen_vimeo vimeo-url id=videoid sd=0 percent=100 ratio=0.5625 center=1 color=#hex autoplay=0 loop=0 portrait=1 title=1 byline=1]
This will display Vimeo videos. At the minimum, you can provide the standard http://vimeo.com/nnnnn link, or just the video ID number (which is part of the Vimeo Link). The other Vimeo specific options include:
- color - You can optionally specify a Vimeo color theme using 6 hex digits for a color value.
- autoplay - Add 'autoplay=1' to have the video autoplay.
- loop - Add 'loop=1' to have the video loop.
- portrait, title, byline - You can specify a value '=0' for these to hide the display of the corresponding element on the Vimeo player.
Portrait is the avatar/icon, title is the video title, and byline is source attribution.
YouTube
[aspen_youtube youtube-url id=videoid sd=0 percent=100 ratio=0.5625 center=1 rel=1 https=0 privacy=0 {youtube options}]
This will display YouTube videos. At the minimum, you can provide the standard http://youtu.be/xxxxxx share link (including the options YouTube lets you specify), the long format share link, or just the video ID number using the id=videoid parameter (which is part of the YouTube Link). The other YouTube specific options include:
- rel - If you specify 'rel=0', YouTube won't show related videos after the video plays.
- https - If you specify 'https=1', YouTube will use the https protocol.
- privacy - If you specify 'privacy=1', YouTube won't used cookies to track your viewing.
In addition to the above [aspen_youtube] options, the shortcode also supports most standard YouTube options. These are more fully described on the YouTube Embedded Player Parameters page.
The supported options, with Aspen S&W's default values include:
'autohide' = '1' . . . . . . 0: always show controls; 1: autohide controls; 2: autohide progress bar
'autoplay' = '0' . . . . . . 1: auto play; 0: don't
'border' = '0' . . . . . . . . 0: no border; 1: border using color1 and color2 (don't seem to work)
'color' = not set . . . . . . progress bar color - red or white
'color1' = not set . . . . . RGB hex value for border color
'color2' = not set . . . . . RGB hex value for control bar bg
'controls' = '1' . . . . . . . 0: hide player controls
'disablekb' = '0' . . . . . . 1: disable keyboard controls
'egm' ='0' . . . . . . . . . . . 1: enable "Enhanced Genie Menu"
'hd' = '0' . . . . . . . . . . . . 1: enable HD playback by default
'iv_load_policy' = '1' . . . 1: show annotations; 3: don't show; 2: discontinued support
'loop' = '0' . . . . . . . . . . . 1: loop video
'modestbranding' = '0' . .1: hide YouTube logo - will still show label in upper right corner
'origin' = not set . . . . . . . See YouTube docs
'playlist' = not set . . . . . . Comma separated list of videoIDs to play (id/url video played 1st)
'showinfo' = '1' . . . . . . . 0: hide video title
'showsearch' = '1' . . . . . 0: hide video searchbox
'start' = not set . . . . . . . start vide this number of seconds from start
'theme' = 'dark' . . . . . . . dark or light - display theme for player
'wmode' = 'transparent' . Keeps video behind menu bars, etc. Other values available - see YouTube
Widget Summary
Aspen Login Widget
This simple widget shows a login in link, or a welcome, Site Admin, and Log out choice if the user is logged in.
Aspen Per Page Text
This widget will work like a text widget, but the title and content are defined by custom fields set on a Per Page basis. For any page, define the Custom Field atw_pp_titleif you want a title, and define Custom Fieldatw_pp_text as the content. Content can include arbitrary text, HTML, and shortcodes. The text will not automatically add paragraphs. The widget will display only if the custom fields are defined when that page is displayed. (This widget won't display on the default blog or other archive-like pages.)
Aspen Text 2
This widget lets you add two columns of text. It is most useful in wide widget areas such as a content top or bottom widget area, or a wide footer widget area.
The Aspen Shortcodes and Widgets Plugin and this document are © 2013, Bruce E. Wampler. Web Site - AspenTheme.com