• Resolved esugrue

    (@esugrue)


    Hi!
    I have searched for a plugin but any I have found are old and haven’t been updated for a while.

    Basically I want to be able to have a dropdown widget that lists all the posts for a category specified.

    So if I specify category id 12 it would list all the posts in that category in a drop down list and go to that post when one is selected.

    I thought it would be easy or maybe I am just looking in the wrong places.

    Can anyone point me in the right direction or to a suitable plugin maybe?

Viewing 7 replies - 16 through 22 (of 22 total)
  • Works great, aldue i dont get them to be sorted alphabetically?

    I dont get that arguments as they should be!

    So… what should i have instead of:

    $args = array(‘numberposts’ => $show_posts, ‘category’ => $cat_id);
    $posts = get_posts($args);

    Gettin nuts here!

    Why isnt there a plugin for this??

    Got it (sorted alphabetically):

    $args = array(‘numberposts’ => $show_posts, ‘category’ => $cat_id, ‘order’=> ‘ASC’, ‘orderby’ => ‘title’ );
    $posts = get_posts($args);

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you make a plugin for it now that you’ve sorted it?

    Sure, i already did (for myself).

    Only thing what is holding me from publishing a plugin to www.ads-software.com, is that Frizax created(?) the code above.

    I dont want to take his credits, i used his code to create a plugin of it.

    (and i dont know how to contact Frizax)

    Thank you Web-Pepper (& Frizax) for the above coding. It has been of great help in tweaking one that I had. Might you be able to help me in getting the titles of the posts to wrap? Some of the post titles are rather long & the selection box is over running the border. Please see sidebar at https://sthughofcluny.org. I’d appreciate any assistance. Thanks!

    What a great solution, although is there a way to put a character limit on the post titles in the drop down menu? Let’s say a limit of 20 characters.

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Drop down list of posts from a category’ is closed to new replies.