Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.31   Updated Tuesday, August 12th, 2008 at 7:19pm

Drop-Down Post List Plugin for WordPress

This plugin allows you to easily display drop-down boxes containing the posts for specified categories. You can use this plugin by entering the trigger text in a post or page, or by adding the function call directly to your theme files. You can display as many drop-down boxes as you like, and you have a choice between a standard select box (with button), or a ‘jump menu’ (as the visitor clicks on a post, they will immediately be taken to that page without having to click a button). Other options are also available.

Download

Demo

This is a generated drop-down post list, listing the posts of a particular category:

Topic: WordPress Plugins and Mods


Installation

  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory
  • Enable the plugin
  • Configure the plugin under the DDPostList options page

Usage

There are two ways you can use this plugin.

Note: In both examples below, replace # with the category ID you want to list posts from.

1) In a post or page, insert the following line:

<!-- ddpl # -->

2) In a template file, insert the following code:

<?php echo ddpl_list(#); ?>

Change Log

  • 08-12-08 Version 1.31 - Small change to produce valid xhtml.
  • 09-27-07 Version 1.3 - Updated to work with WordPress 2.3. Added ‘Load Default Options’ button.
  • 08-01-07 Version 1.2 - Option added to specify default option in list.
  • 07-29-07 Version 1.1 - More options added.
  • 07-28-07 Version 1.0 - First release.

Modifications

The code this plugin generates is fairly plain (no special formatting), but to make customization easy, the form has been assigned a CSS class: ddpl-form

For example, if you would like to set the width of the select field, add this code to your theme’s style sheet:

form.ddpl-form select { width: 200px; }

Options

Here are the current options available (found under the DDPostList options page)

Form Type - You can choose to have the plugin generate a ‘jump menu’, or a traditional list with a submit button

Default Option - If entered, this is the first option that will show up in the list (does not link to anything)

Button Text - If using a traditional list, this is the button text

Sorting Method - You can choose to sort by post date (ascending or descending), or post title

Post Limit - This allows you to define a limit for the number of posts in the list (0 for no limit)

Add Before Form - Code added here will be displayed before the generated form

Add After Form - Code added here will be displayed after the generated form

Add Before List - Code added here will be displayed before the list

Add After List - Code added here will be displayed after the list

Pages: « 4 [3] 2 1 » Show All

  1. Nice and simple plugin :) Thanks a lot for sharing!

  2. can this plugin be change to list pages as a drop down?

  3. Version 1.31 has been released. It is just a small code change to produce valid xhtml.

    Stout: I tested, but it showed my private posts just fine.

  4. 42
    Stout

    Hello !
    This great plugin doesn’t show the private posts, even when logged…
    Any Ideas on how to enable that ?
    Thanks !

  5. I have a main category id 15 with no posts under it, but it has subcategorys with posts. How can I make putting id 15 show all posts from the subcategorys.

  6. 40
    Devin

    Hello. I love this plug-in, its great for webcomics, BUT I also want to use this with a W3C xhtml 1.0 Valid website. When I add this plug-in My website is no longer valid xhtml. I think the error lies in the plug-in itself, as this page generates the same kind of validation error because it has the plug-in.

    http://validator.w3.org/

  7. Despite accurate settings in admin, some of my recent posts are not displayed at all, and some old ones are mixed into the most recent posts. Wonder what I’m doing wrong… - running latest Wordpress, maybe that’s the problem? - Beautiful plugin, though - help greatly appreciated!

  8. What if I want this to work on all categories? how can I make it work with all categories?

  9. my bad sorry, just found it under Settings. Great plugin btw thanks

  10. sorry but how do i set the options for the drop down? I’ve activated the plugin but I can’t see any option settings?

  11. I want to display a non-dropdown list of every post in one category on a page is this possible?

  12. Sorry, but for I reveiving Parse error: syntax error, unexpected ‘;’, expecting ‘)’ , I’ve checked everythings.. Could somebody help?

  13. 33
    cobb

    Thanks for this. I’m using wordpress 2.5.1 and whilst the drop down shows in the post I don’t get any entries. Any suggestions much appreciated as I really like this plugin.

  14. Thanks a lot for this plugin….

  15. Here is a workaround for my desire to have a single tag list all posts.
    1. Install and activate DDPL
    2. Create a new, dedicated category for this sole purpose
    3. Add all posts to this category
    4. Download, install and active one of many plugins designed to hide categories. Here’s a start: http://www.google.com/search?q=hide+category+plugin
    5. Hide the new category
    6. Use the DDPL tag to call the new category (i.e.
    <?php echo ddpl_list(6); ?> )
    You should be good to go.

Pages: « 4 [3] 2 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.