Table of Contents
- Spread the word, like and share
- How to use the widget
- HTML Structure
- CSS Structure
Spread the word, like and share – top
If you like this free plugin please don’t forget to spread the word, like it, share it so other people can try it too. Thanks in advance!
Description – top
Build lists of posts based on options you choose from a form in a widget. It works similar to SQL query but no coding knowledge is required!
Once you install the widget you can go to your WordPress widgets (Appearance -> Widgets). Drop the widget in a sidebar. Fill the widget’s form, save and have your list prepared for you.
You can drop the widget in as many sidebars you like and build as many independent lists as you like. Every list can have a different content.
Most themes for WordPress will come with default sidebars and a few footer areas where you can drop widgets in. If you want to have custom widget areas for instance in content areas of your pages and post, or any other area of your site:
- Create your custom widget areas by using a plugin. It’s fast and easy.
- Create your custom widget areas by little coding – advanced users.
- Use an advanced theme with more widget areas defined.
You can create a fully functional website using this widget.
Installation – top
Install the plugin just like any other WordPress plugin. Here is an article on how to install a plugin in WordPress.
How to use the widget – top
Once you install the widget go to your widgets section (Appearance -> Widgets). Look for a widget called Smart Post Lists. You can drop the widget in as many widget areas (sidebars) you like and build as many independent lists as you like.
By filling a simple form this widget will build your list based on the options you choose. The form works like an SQL query and controls select expression, where condition, order by expression, limit expression. No coding is required!
When you drop the widget in a sidebar (widget area) you have the following options to choose from:
Here is a description of all the options available:
- Title – The title that will be displayed on top of your posts list (default widget title).
- Categories – Posts from the selected categories will be included in your posts list. You can select as many categories as you like.
- Tags – Posts that have the selected tags will be included in your posts list. Enter the tags comma separated. This field is auto complete and gives you suggestions when you start typing.
- Authors – Posts from the selected authors will be included in your posts list. You can select as many authors as you like.
- Post Count – Fill in the number of posts to show in your list.
- Post Offset – Fill in the number of posts to skip before start counting Post Count.
Example of Post Count and Post Offset:You have to following posts ordered in the same way shown in this example: Post1, Post2, Post3, Post4, Post5.If you set Post Count to 3 and Post Offset to 0 your list will look like this: Post1, Post2, Post3.If you set Post Count to 3 and Post Offset to 2 your list will look like this: Post3, Post4, Post5.
- Order By – Order your list by: date created, date modified, post title.
- Order to display posts – Choose from ascending or descending.
- Show title – If this is checked post titles will be shown in your list. Titles will be links to the original posts they represent.
- Show date – If this is checked post date will be shown in your list. The widget will use the date format set in your WordPress installation (Settings -> General -> Date format)
- Show excerpt – If this is checked post excerpt will be shown in your list. If a post has empty excerpt the widget will show the post text. Images and all HTML tags will be stripped from the text.
- Excerpt length in words – Fill in a number of words to show. The widget will first try to count the entered number of words from the excerpt. If the excerpt is empty it will count the number of words from the post text. Images and all HTML tags will be stripped from the text before counting. Only text will be counted.
- Show number of comments – If this is checked number of post comments will be shown in your list. The number is a link to the post comments section of the post it represents.
- Show thumbnail on post – Choose to show image on all posts (all) or no posts (none). The widget will look for post’s featured image.
- Image float – You can choose the image float: top of excerpt, right of excerpt, left of excerpt.
HTML Structure – top
Every list contains a <h3> widget title and <ul> list of posts. Every <li> list member contains two divs. One of them containing the image for the post. The other one containing the text – post title, post date, post comments, post excerpt.
CSS Files and Structure – top
The CSS file is located in the plugin’s folder and it is named splw.css. The file is separated into well named section:
/* FRONT END CSS */ – front-end general styles
/* FRONT END CUSTOM CSS */ – front-end styles that you can use to customize the look of your lists
/* ADMIN CSS */ – admin styles for the widget
PHP – top
There is a php file located in the plugin’s folder and it is named splw.php. It contains all the php code for the plugin. The code is separated into functions. Each of them has a short description of what it does.