WP Dropdown Posts Plugins

Sometime you want to display WordPress Posts list in a dropdown style just like WordPress Page does. Unfortunately this feature is not available in WordPress. But dont’ worry guys, I have created a plugin for this purpose. WP Dropdown Posts will shows posts list in dropdown and if you click on an item, you will be redirected to that post.

WP Dropdown Posts
Author: takien
Contributors: takien
Donate link: Donate
Tags: post, dropdown, jump, menu
Tested up to: 0.1
Stable tag: 0.1

This plugin will show post list as dropdown

Description

This plugin will show post list as dropdown just like wp_dropdown_pages, most parameter wp_dropdown_pages are accepted too.

Screenshot

Dropdown Posts

WP Dropdown Posts

Installation

1. Upload the ‘wp-dropdown-posts.php’ file to the ‘/wp-content/plugins/’ directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Paste the following code to your theme file, e.g in your sidebar.php

WP Dropdown Posts

[raw]<pre>
wp_dropdown_posts('sort_column=post_date&sort_order=DESC&number=5');</pre>
<p>[/raw]

That will show latest 5 posts in dropdown.

$10.99 .CO Domains!

Incoming search terms:

  • wp dropdown posts
  • Drop-Down Post List Plugin for WordPress
  • wp dropdown
  • wp_dropdown
  • wp dropdown post
  • wp dropdown menu
  • wp dropdown categories
  • wp drop down posts
  • wp dropdown tags
  • wordpress custom post category dropdown
  • http://www.semprot.com Forum BB17

    Nice plugin, man.

    • takien

      Thanks… :D

  • http://www.maheshwaran.net Maheshwaran

    Hai,

    Is it possible to choose / modify the number of characters in the Post title displayed in the dropdown box? I am working on a site for my friend, there some of teh posts have too lengthy characters, so the dropdown box exceeds the sidebar, so disturbs the whole layout.

    Awaiting your fix on this issue

    Regards,

    Maheshwaran. I

    • takien

      Thanks Maheshwaran,
      The plugin is now updated to version 0.2 with new parameter to cut long titles. Please see changelog in wordpress.org
      And go to your dasboard to update.
      Thank you.

  • http://WWW.0001.TK :RG:

    is it possible to style it with scc somehow..?
    would be really cool if u could give me some pointers.. maybe .class -es i need to look into?

    • takien

      do you mean CSS? it’s okay. please search google about how to css..

  • http://WWW.0001.TK :RG:

    hi there
    its me again…
    this is my third day browsing google for solution … :(

    i was trying to style it this way but no success… :S
    http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/
    actually i would love a final result like this examples ..
    im kinda new to php.. maybe that’s the problem..
    can u please help me out here
    i really appreciate your time..

    • takien

      that’s all about CSS… please learn it.

      sorry for late reply.. im so busy :(

  • http://javu.org Online Social Bookmark

    thanksk for share :)
    i really need this plugin for my blog

    btw,,,nice theme here inspired from php.net

    • takien

      thanks :)

  • http://emboech.co.cc emboech

    mangstab gan! ijin sedot ya..

    • takien

      silahkan gan :D

  • http://claritycoverdalefury.com/agency ccfangel

    Is there a way to filter the dropdown to a specific category? It currently shows all of my posts; I would like only x category to appear within the dropdown.

    • takien

      Please refer to my reply to Petr below

      Thanks

  • Petr

    Hi, nice plugin! Is is possible to filter posts and display posts only from category Countries? Thanks!

    • takien

      Thanks Petr,
      try this
      [php]
      wp_dropdown_posts(‘cat=country&sort_column=post_date&sort_order=DESC&number=5′);
      //where ‘country’ is cat slug for Country category
      [/php]

      OR

      [php]
      wp_dropdown_posts(‘cat=10&sort_column=post_date&sort_order=DESC&number=5′);
      //where ’10′ is cat ID for Country category
      [/php]

      • http://claritycoverdalefury.com/agency ccfangel

        Hi there,
        The addition of cat= does not work; it is just pulling the latest posts, and not filtering by category. Can you look into the cat= functionality?
        Thanks.

        • Kisalay Somani

          The functionality was never built-in and hence the issue.
          Here’s a quick and dirty fix.

          Open the php file for the plugin.
          Around line 70, within the array add the following line.

          ‘category’ => 0,

          Then around line 79 add,

          $category = (int) $category;

          Finally, before the line if ( $parent >= 0 )
          add the following piece of code.

          if ( $category >= 0 ) {
          $join .= ” LEFT JOIN $wpdb->term_relationships ON ( $wpdb->posts.ID = $wpdb->term_relationships.object_id )”;

          $where .= $wpdb->prepare(‘ AND term_taxonomy_id = %d ‘, $category);
          }

          Save the file and pass category=cat_id in the call where cat_id is your category id number.

          • Kisalay Somani

            For those seeking perfection, I think the following change would reflect the WP structure more accurately.

            WHERE {$table_prefix}posts.ID = {$table_prefix}term_relationships.object_id
            AND {$table_prefix}term_relationships.term_taxonomy_id = {$table_prefix}term_taxonomy.term_taxonomy_id
            AND {$table_prefix}term_taxonomy.taxonomy = ‘category’
            AND {$table_prefix}term_taxonomy.term_id = {$catID}

  • Leo

    Nice plug-in. I have the same problem as above. Is there a solution yet? I want to list a dropdown menu with related posts under each category heading separately.

  • Alex

    Thank you Kisalay Somani,
    but where exactly you want us to add this piece of code?
    Thank you very much,
    Alex

  • http://www.awidea.com hussain

    How to add an option Choose Post…. as Default?

  • http://dofollow.de Martin

    Very nice plugin!

    i got same prob as petr:

    if a user is in a specific category, the drop-down-menu should only show posts from that specific category and not from all posts. I have try your “dirty fix” but it does not work for me. I really would like to use that plugin in the above way. So, How much is it , if you fix that prob for me?

    sincerly
    Martin

  • Lluis

    How can I do to make it works with custom post types?
    Thanks, greta plugin

    • takien

      not support with custom post type yet, but it’s possible. wait for the new release.
      thanks

  • http://comprarlibrosinternet.com Marcos

    Hi, finally I found your plugin :) , thanks for sharing your good work.

    How can I sort the DDL by ABC?, as you can see I have a large catalog of books, and I have basic knowdlege on PHP.
    can I do it from
    [php][/php]

    or I need to change the .php files….

    thanks

  • http://comprarlibrosinternet.com Marcos

    I don’t have idea why my last comment is shown without the code, I mean change the code from

    thanks

  • kebab2kuk

    Took me a long time to find and thank you.

    I have an issue that when the page is loaded the dropdown list automatically focuses on the first post. Then if you goto select that post, it will not load. It’s as if its not registering that its been clicked.

    Is there a way to add a title or similar. Say “Choose Post” which is top of the list?

    Any tips would be appreciated.
    Regards
    Steve

    • takien

      Hello kebab2kuk,
      thank you for using my plugin. Yeah, it’s possible to do. Unfortunately, I’m so sorry I’m not have much time to maintenance this plugin, I’m not promising but i will try keep the plugin is useful to everyone.

  • Pingback: You Cards by Susan – Website Almost Done « Journey to a WordPress website

  • http://wpsmith.net Travis Smith

    Hello,

    How’s the new release coming along to support various post types?

    Thanks,

  • alex

    ERROR!!!!!
    Can’t find variable: dropdown_post_js

  • http://www.gazeteler.de gazeteler

    nice plugin,  thx

  • Anonymous

    Hey there!

    Is it possible to assign a custom class to the element?

    Thanks for the plugin!