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.33   Updated Monday, July 6th, 2009 at 6:18pm

Drop-Down Post List Plugin for WordPress

This plugin allows you to easily display drop-down boxes containing the posts for specified categories (or all 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

  If you have found this page useful, please consider donating. Thanks!

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, or use the word all to display posts from all categories.

1) In a post or page:

<!-- ddpl # -->
<!-- ddpl all -->

2) In a template file::

<?php echo ddpl_list(#); ?>
<?php echo ddpl_list('all'); ?>

Change Log

  • 07-09-09 Version 1.33 – Added method to display posts from all categories. Changed the way the WP version was being detected for calls to the database.
  • 02-17-09 Version 1.32 – Small change to produce valid xhtml when using more than one drop-down on a page
  • 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: « 1311 10 9 8 7 6 5 [4] 3 2 1 » Show All

  1. we should be able to add more than 1 category…

  2. 59
    Saulo Benigno

    Does it work with WP 2.7?

    Thanks.

  3. 58
    Scott

    unless…..the small recent upgrade from WP 2.6.3 to 2.6.5 broke it? That about the only thing that changed, and that was only 2 new files I think.

  4. 57
    Scott

    OK – I’m a bit confused. Last week it was working fine, now it isn’t! The drop-down list does not show anything. I restarted the plugin – no luck. I’m not getting errors or anything, just nothing in the drop down. Any ideas? My syntax has not changed. Hmmm.

  5. 56
    EgitimTUBE

    Thanks Very Good

  6. 55
    Karl

    Great plugin,

    How would i go about showing posts from ALL categories (i have over 40!) in the dropdown?

    Thanks

  7. Great.. works excellent for me.

  8. when i put in my sidebar, i don’t see anything post can i click in drop down menu. What’s problem with this..??

    if i change to that’s is same..

    if I deleted display

    “Warning: Missing argument 1 for ddpl_list(), called in /home/****/public_html/wp-content/themes/********/l_sidebar.php on line 25 and defined in /home/****/public_html/wp-content/plugins/dd-drop-down-post-list.php on line 168″

  9. 52
    kroma

    hmm some of my plugins caused problems … it works now

  10. 51
    kroma

    it doesn’t work for me :( if i try to enter in in the template or just enter it on page it doesn’t work :/. only shows me (selec a post) in menu

  11. 50
    norbesz

    sorry! there’s no problem :) if i log out (or see the site from an other browser) everything works normally
    thanks again for the plugin! :)

  12. 49
    norbesz

    hi! thanks for this great plugin. but i have a problem. it doubles the posts in the list :S
    example here:
    http://cserkesz.hu/~mukso205/?page_id=267
    i use another 2 category plugin, i think it will be the problem, but i want all of them :) (if i turn off the plugins the mistake still remains)
    the plugins are : folding categories for wordpress and front page excluded categories
    any idea?

  13. 48
    cartmanffc

    any chances you could make the plugin for a drop down menu of authors in a similar way this plugin works

  14. I REALLY APRECIATE, ITS A GREAT PLUGIN, WAS HELP ALOT
    THE SAMPLE ITS BELOW
    REALMENTE LO APRECIO ES UN GRAN PLUGIN ME AYUDO MUCHISIMO LA MUESTRA ES ESTA
    http://soylibreencristo.com/?page_id=457

  15. 46
    Devin

    Thank a TON for the update!

Pages: « 1311 10 9 8 7 6 5 [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.