WordPress Lists Plugin v1.9
Welcome to the WordPress List Manager Plugin (wp-lists). As the name implies, this is a List Manager for WordPress 1.5.x which facilitates the management of lists directly from the administrative console. This means you can create a list of anything you want and then add, edit or update that list anyway you please from one centralized location. Any changes to that list are then reflected globally.
This is generally what happens to me when I try to compose and update a list using HTML markup: I hard code the list into post or page and then never go back to update it because it’s a hassle to find the appropriate entry and then edit it while making changes in the HTML and ensuring nothing in invalidated. What I would like to do is have a central repository of all my lists that can be easily controlled from within WordPress admin. By using this plugin, you are consolidating all your lists into one central location which can then be dynamically updated no matter where it appears or how many times it appears.
The plugin allows a new custom <list id="#" /> tag which will embed a list inside a post or page. Moreover, a “Embed List” buttons is added to the quicktags for easy reference. In addition to embedding lists inside posts or entries, you can also call the methods from any included WordPress .php file using the several provided API methods. That way, you can quickly throw a list of your lists on to your sidebar or where ever your tiny little heart desires.
This plugin currently only works for WordPress 1.5.x. I am sorry if you are using 1.2.x but I will not back port it for your convenience. I know you probably hate me and want me to die, but really, it’s not necessary to wish such harmful things upon me. Please be kind.
Let me reiterate: this plugin only works with WordPress 1.5. The number of trouble reports I get with people trying to run this plugin with WordPress 1.2.x is astounding which only proves my theory that people seldom read on the Internet. You can download the latest version available here (changelog).
Listen carefully, if you don’t follow these instructions impeccably, you may destroy the Internet. So, for your sake, mine and all of humanity, let’s go through this together.
- Download the Latest Available Version
- Extract the Zip Archive
- wp-lists.php to your /wp-content/plugins/ folder, and
- edit-lists.php to your /wp-admin/ folder
That’s it. You’re done. To ensure that the plugin has been successfully installed, simply navigate to the Manage interface, where you should see the new entry Lists listed in the submenu.
How do I insert/embed a list inside a post or page?
In a post or page, you can simply add the following code to embed a list. Alternatively, if you do not know the list id number, you can use the “Embed List” button on the quicktags menu. Regardless of your insertion method, you should have something like this:
<ul> <list id="23" /> </ul>
which would yield something like:
However, you can also use the following optional attributes:
- showlinks: if false, it will not hyperlink the list items
- showchecked: if false, it will not display which items have been
- odd: the class name given to every other (odd) <li>
- even: the class name given to every other (even) <li>
Both showlinks and showchecked are considered to be true by default, whereas odd and even are not used by default. Odd and even are classes which are passed to each individual <li> of the list. These items can then be styled using CSS to alternative colors or even change the formatting.
<ul> <list id="1" showlinks="true" showchecked="false" odd="odditem" even="evenitem" /> </ul>
would generate the following code:
<ul> <li class="odditem"><a href="http://www.google.com">Google</a></li> <li class="evenitem"><a href="http://www.a9.com">A9</a></li> <li class="odditem"><a href="http://www.yahoo.com">Yahoo</a></li> </ul>
which would produce the following results:
How do I get the last updated time of a list inside a post or page?
You can use <list id="#" attribute="lastmodified" /> but that will format the date and time as defined by the default WordPress settings. Generally, you may want to change this behavior. To accomplish this, there are several other parameters to use with the lastmodified attribute:
<list id="#" attribute="lastmodified" format="g:ia" gmt="false" />
- id: just like the normal list tag, we need to know which list we are dealing with.
- attribute: we need to know what attribute we’re looking for, so set this to lastmodified or lastupdated (same thing).
- format: if you omit this tag, it will automatically grab the default WordPress values, otherwise use the PHP date() syntax to specify the format. (optional)
- gmt: if you want to display gmt instead, set this value to true. defaults to false. (optional)
How do I get the number of items that are in a given list?
<list id="#" attribute="count" />
How do I get the number of items that are checked off in a given list?
<list id="#" attribute="countchecked" />
How do I add a list of lists into my sidebar?
Basically, in your sidebar, you should add something along the lines of:
<?php wplists_get_lists(); ?>
How do I put a specific list of items in my sidebar?
Again, in your sidebar, you should add something along the following lines:
<h2>Top 5 Albums</h2>
<?php wplists_print_by_id(1) ?>
where 1 is the ID number of the list you are attempting to display.
Can I hide certain lists from being listed?
Yes, when editing the list, simply mark it as private in the administrative console.
Do you have any working examples on your website?
Yes, I have several instances were the features can be seen in action:
- On the sidebar, under lists, you’ll see a dynamic lists of lists.
- Those lists are then linked to a series of lists that I use throughout the site, including a list of my DVD Collection as well as a list of 50 Things I Would Like to Accomplish Before I Die.
How do I import entries?
When you are editing a list, simply click on the Import button. This should launch a new popup window containing a large textarea. You may now paste your list inside this textarea. Each item should be on a separate line and you can use the following syntax to link items: name|link. Therefore, for example, you can try and import the following list to better understand how the import works:
Does this plugin work with WordPress 1.2.x?
No. I do not yet have an instance of WP 1.2 running so I cannot test nor ensure that it is working properly. However, WordPress 1.5 has been released so go ahead and upgrade. Join the darkside.
The following are a list and descriptions of the API methods available as of the lastest version of the plugin. If you are using an older copy, some API methods may be different and/or outdated. Always ensure that you are running the latest version available.
wplists_print_by_id( $list_id, $before = "<li>", $after = "</li>", $showlinks = true, $showchecked = true, $echo = true ); wplists_return_list_by_id( $list_id ); wplists_get_lists( $before = "<li>", $after = "</li>", $linkurl = true, $orderby = "id" ); wplists_last_modified( $list_id, $format = "", $gmt = false, $echo = true ); wplists_count_total( $list_id, $echo = true ); wplists_count_checked( $list_id, $echo = true );
As of wp-lists v0.9 and above, you no longer need to use any special plugins to embed lists inside posts or pages. You can simply use the “Embed List” button on the quicktags bar, or if you know the id number you can manually enter <list id=”#” />.
So, for whatever reason, you’ve decided to insult me and shame my family by uninstalling my plugin that I worked oh-so very hard on. Huh? What do you have to say for yourself? Alright, if that guilt trip didn’t work then I guess you’re pretty serious about your commitment on destroying my life. At any rate, here are the instructions you requested, bastard:
- If you’re just looking to turn-off the plugins’ capabilities, you can simply deactivate it through the Plugins interface
- If you’re you’re looking to completely delete the files, make sure you deactivate the plugin first and then delete:
- edit-lists.php from your /wp-admin/ folder, and
- wp-lists.php from your /wp-content/plugins/ folder
- Finally, to delete the data, you need to drop wp_lists and wp_lists_items from your MySQL database. If you need help with this step, check out this very straightforward tutorial. Please be aware that you can delete the files and keep your data in tact only to return to it at a later time by reinstalling the plugin.
- I believe using slashes (/ and \) inside the format parameter string for the lastmodified attribute does not work.
Troubleshoot / Help
If you have any problems with this plugin, send me an email and I will do my best to help you out. I can’t guarantee that I can solve anything but I’m willing to try. If there any feature suggestions, bug reports or just general comments — please email me at email@example.com. I love you. Thanks.