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.3   Updated Thursday, September 27th, 2007 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

  • 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

  1. microsoft me clean vacant all

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

  3. 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?

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

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

  6. 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.

  7. Thanks a lot for this plugin….

  8. 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.

  9. Hi,

    I’ve been trying to get your plugin working here:
    http://wirelife.co.uk/?page_id=7

    But it doesn’t seem to be working. If you could help me i’d be very grateful.

    Regards,
    Davthalas

  10. I can change the list name, or what’s supposed to show in the box first… such as (Choose One)… but nothing shows there. It is always just the first item / page that shows up. How can I make the first thing be the (Choose One)?

  11. Is there anyway to change the List name

    For example the defautlt is set to “Select a Post” I tried searching in the plug in to change to a different text like “more posts here”

    But cant figure out how..

  12. Let me add my voice to those asking for a way to use this plugin to display all posts from all categories. That would be a huge help!

  13. Was I-O’s question ever answered? I have the same question. What happened to support for this plug in.
    I would like to display the drop down list at the bottom of my individual category pages.

    EG// say I have 3 categories Parties, Recipes and Events when you click on these the first 5 posts for each are displayed and at the bottom is the drop down list for all of them…I tried pasting it into category.php and got a blank page.

  14. Hi, when I try to download the plugin on this page, it doesn’t work

  15. Is there a way to set a variable for category ID so you can inset the code in the single post template and it automatically checks the category ID and displays those posts in the drop down?

  16. I can’t get the “Default Option” to show up on the form.
    Any ideas why?

  17. 22
    reagan

    Does it support Pages?I want to have a dropdown list for PAGES too.

  18. i got a problem when i activate this plugin….

    when i activate this plugin, visual editor tab will be disabled in my write page….. what can i do????

  19. 20
    Alvin

    Hi,

    I’m very new at wordpress.. how do you make it appear like what’s on http://www.hernadezlife.com? Its basically sitting on the right hand sidebar with a title called All Entries.

    Thanks

  20. the code form.ddpl-form select { width: 200px; } doesn’t work

  21. 18
    Johnny

    sorry…forgot to wrap the code

    <?php echo ddpl_list(#); ?>

  22. 17
    Johnny

    pasting in

    gives me a syntax error?

    Parse error: syntax error, unexpected ‘;’, expecting ‘)’ in….

    i am pasting it into my sidebar.php page

    weird?

  23. I realize that it is possible to setup several of your tags to display all posts from all categories,… but can you setup just one tag to display all posts from all categories?

    Sorry,… I don’t believe that I was specific enough with my previous post on this subject.

  24. Is it possible to setup the <?php echo ddpl_list(#); ?> tag so that it will automatically follow the appropriate category such as the <?php the_category(', ') ?> tag to eliminate manual insertion?

  25. Karin: It is a demo, yes.

  26. 13
    Karin

    Isn’t wat is shown under ‘demo’ here above not a demo?

  27. Is it possible to display ALL posts from ALL categories?

  28. Does this drop down menu include the sub-categories as well? For example, let say I have “colors” with the sub category of “red”/”blue”/”orange”, will this plugin list the subcategories in the parent category?

  29. 10
    eric

    Great plugin! Thank you once again!!

    Ditto what Corrine said. It would be great if the menus could display links to posts OR links to categories/subcategories.

  30. 9
    goodhand

    excellent solution, thanks so much.

  31. Thanks - this worked great and I need things to be very simple. I did it!

  32. This is exactly what I was looking for. Very easy to use and works with no problems. I’m trying to create a static home page and this will help a lot. Thanks for the plugin.

  33. Thanks. I really like your plugins. I just upgraded to WordPress 2.3 and was pleased to see that your plugins were compatible. This was not the case with some of my other plugins - as a result, I had to ditch a few of them and I replaced one of them with this one.

  34. Version 1.3 Released

    This update adds support for WordPress 2.3, and will also still work in 2.1 and 2.0.

  35. Is it possible to have a version to display link categories?

    I guess that would require a lot of extra work…. Just a thought.

  36. How do I display all posts from all categories? Can you post some code about that?

  37. 2
    gentoo7

    this is awesome, thanks a lot!

  38. Sounds good. But a demo would be nice :)
    I’m gonna try it out anyway.

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.