Weaver Plugin Documentation
Weaver Show Posts
Version 1.2
This document has information about Weaver Show Posts. This plugin allows you to show selected posts anywhere on your site that you can use a shortcode.
Important Note: This plugin was formerly called ATW Show Posts. The name has been changed to Weaver Show Posts to tie it in to our other plugins and themes. There is no functional difference between the old and new versions. To preserve compatibility, many classes will retain their previous ".atw-class-name" naming conventions.
Table of Contents
- Plugin Summary
- Weaver Posts and Slider Admin Page
- [show_posts] Shortcode
- How To Add Shortcodes to Your Content or a Sidebar
Plugin Summary
The Weaver Show Posts plugin allows you to show posts and posts with a custom post type anywhere your theme supports shortcodes. You can specify which posts will be displayed using an interactive filter design page.
Weaver Show Posts has a companion plugin. The Weaver Show Sliders plugin allows you to create sliders and slide shows to display images and posts using a shortcode. You can use the Show Posts filter options to specify which posts or posts with images will be used by the slider. Can also specify an images show using the standard WordPress Media Library Create Gallery interface.
The Show Posts plugin is a stand-alone plugin, and can be installed and used independently of the Show Sliders plugin. The Show Sliders Plugin requires the Show Posts plugin to work.
Weaver Posts and Slider Admin Page
The administrative interfaces for Weaver Show Posts and its companion, Weaver Show Sliders will be added as a menu item on the Dashboard Menu. If you have just the Show Posts plugin installed, then the menu will be called Weaver Show Posts. If you have both plugins, the menu is called Weaver Posts/Slider, with an additional Dashboard menu called Slider Posts used to define custom pages for your sliders.
Using Shortcodes
Shortcodes are an important part of WordPress. They allow you to insert a shortcode - a named entity surrounded by [square brackets] anywhere into your pages and posts. The [show_posts] shortcodes makes it easy by adding an "Add [show_posts]" button above the icon bar in the Page and Post editor.
You can also insert the shortcode anywhere else that a theme, plugin, or widget area supports shortcodes. Note that by default, the standard Text Widget does not support shortcodes. Some themes and plugins extend the Text Widget so it supports shortcodes. If your theme doesn't do that, you can check the option at the bottom of the Weaver Show Posts admin tab to add shortcode support to the standard Text Widget.
[show_posts] Shortcode
The [show_posts] shortcode 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.
Which posts are displayed are controlled by the filtering options set on the Filters tab, or 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 [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.
Defining a Filter
When WordPress displays posts, whether that be on the standard blog page; an archive type page such as categories, tags, dates, or the like; or the posts displayed by [show_posts], it uses a set of filter specifications to select which posts to display in a specific order. For example, the standard blog page will show all posts displayed in descending date order, with sticky posts shown first. A category archive (like categories displayed from the standard WordPress Categories Widget) will show only posts from a specific category.
The Weaver [show_posts] shortcode will display whatever posts you want to specify. WordPress supports all sorts of options for selecting posts, and the Show Posts Filter tab makes it easy specify just which posts you want displayed.
You can define as many different filters that you need. You create and name each Filter in the Filters "Select Filter" box. The rest of the Filters tab lets you set different display and post selection options.
Filter Display Options - Theme Interaction
By default, Weaver Show Posts will normally use its own simple layout of posts. There is typically some interaction with the native theme styling - titles, content fonts, images, etc - but the default will usually not look too bad. If used with the Weaver II or Weaver Xtreme themes (themes developed by the author of this plugin), posts will be displayed using the native Weaver II or Weaver Xtreme display functions by default. Weaver Show Posts can also use the native post display functions of many other themes.
There are several options to control how each post is displayed. The normal elements of any post includes the post title; post meta information such as date, author, categories, tags, and featured image; and the main post content displayed as the full post or an excerpt. There are options to display or hide each of these elements. The display/hide option work for the built-in post display functions and the Weaver II or Weaver Xtreme native post displays, but not the native post display functions supported by some themes.
To summarize, the [show_posts] can display each post using one of three methods: its own built-in post display function, the native post display function used by the Aspen, Weaver II, or Weaver Xtreme, or the native post display function used by many (but not all) WordPress themes. In the latter two cases, post will be displayed so that they match other posts displayed by your theme. You can select which of these methods is used to display posts.
The option to use your theme's native display will not be included unless the theme has a file called content.php. For themes that have this function (over 50% do), most will display posts from [show_posts] nearly the same as they display standard blog posts. However, some themes will have glitches and not give satisfactory display. You should experiment with that setting to see if you get the results you want.
In any event, you can use the plugin's built-in post display function, and usually get very satisfactory results. The plugin contains a tab called Custom CSS that can be used to provide custom CSS styling to help the built-in post display better match your theme's native post display. These are the classes used by the built-in post display:
- .atw-show-posts - wraps each post
- .atw-entry-title a - the title (h2 a)
- .atw-entry-meta - top meta info line
- .atw-entry-header - wraps title + meta
- .atw-featured-image - wraps the FI
- .atw-entry-content - wraps full content
- .atw-entry-summary - wraps excerpt
- .atw-entry-utility - wraps bottom meta info line
- .atw-show-posts .sticky - sticky posts
Note that the Custom CSS option can be used to provide your own custom CSS Styling for any part of your site - without the need to edit your theme's style.css file (-you should NEVER do that anyway). However, providing information on creating CSS rules is beyond the scope of this documentation. While CSS may seem beyond the level of non-technical WordPress users, there are plenty of tutorials available on the web, and you can add lots of fine tuning to almost any theme with a bit of custom CSS.
Filter Selection Options
The Filters options provided by the plugin are generally descriptive of what they do. From a technical standpoint, they exactly match the options supported by WP_Query, the PHP function used by WordPress to determine which posts to display.
Technical note: There are a few of the options (Post Type, Categories, ByPost IDs) that are often needed by [show_posts], but don't have an exact equivalent in WP_Query, but are manipulated by the plugin to the appropriate values needed internally. But note that there is one option, "Custom WP_Query Args", that allows you to specify many of the possible WP_Query args not included in the Filters tab. For security and technical reasons, any args requiring an "array(...)" value is not supported by this option.
You can't mess up your WordPress database or any other content by experimenting will all these options. So feel free to play with all the options to see just how flexible the Filters tab is for selecting posts to display.
Summary
The Weaver [show_posts]
shortcode allows you to display posts on your pages or in a text widget
in the sidebar. You can specify a large number of filtering options to select a specific set of posts to show.
The recommended way to display posts is to specify all the filter selection options on the Filter tab, and use the [show_posts filter=filter-name] form of the shortcode. You can also specify the options manually.
Summary of all parameters for [show_posts] shortcode, shown with default values:
cols=1 | display posts in 1 to 3 columns |
excerpt_length='' | Specify the length of automatic post excerpts in words |
posts_per_page='' | Number of Posts to Show (Use -1 for all. Default: Settings->Reading value) |
filter='' | use named filter - all other parameters ignored when filter specified |
hide_bottom_info=false | hide bottom info line |
hide_featured_image=false | hide featured image - FI is displayed by default |
hide_title=false | hide the title |
hide_top_info=false | hide the top info line |
show=full | show: title | excerpt | full | titlelist | title_featured |
show_avatar=false | show the author avatar |
more_msg="New More Message" | replacement for Continue Reading excerpt message |
use_paging=false | Use paging when displaying multiple posts |
category_name=list | list of categories by slug |
post_ids | list of posts by IDs |
post_slug | single post by specified post slug name |
WP_Query args | Any standard WP_Query argument (not including those needing array()). Using these options directly requires fairly advanced technical understanding, and is intended for advanced users. |
You don't need to supply every option when you add the [show_posts]
to your own content.
You can wrap the parameter values with double or single quota ion marks if you want, but they aren't needed
unless the value has a space (e.g., the more_msg example).
How To Add Shortcodes to Your Content or a Sidebar
Both Weaver Show Posts and Weaver Show Sliders work through the standard WordPress Shortcode feature. To add a Show Post to your content, insert [show_posts filter=filter-name] into a page or post. To insert a slide show, add [show_slider name=slider-name]. To make this easier, there are Add [show_posts] and Add [show_slider] buttons above the Page/Post editor icon bar.
You can also add these shortcodes to a sidebar using a standard Text Widget. Simply add the shortcode (you can copy the current settings for the shortcode from the version displayed near the top of either the "Show Posts" tab or the "Sliders" tab, then paste them into a Text Widget. Many themes an plugins already add the ability to include shortcodes in the Text Widget, but if you just see the shortcode displayed in the Text Widget when you view your site, open the "Show Posts" tab, and click the option at the bottom to allow the Text Widget to include shortcodes.
The Weaver Show Posts Plugin and this document are © 2014-2016, Bruce E. Wampler. Web Site - WeaverTheme.com