WordPress.org

Ready to get started?Download WordPress

Forums

Random Posts from Category
[resolved] posts from more than one category (4 posts)

  1. Brin Wilson
    Member
    Posted 1 year ago #

    Hiya,

    I'd like to specify more than one category from which to pull in random posts, is this possible?

    Thanks,
    Brin

    http://wordpress.org/extend/plugins/random-posts-from-category/

  2. Stephanie Leary
    Member
    Plugin Author

    Posted 1 year ago #

    It's not something I want to introduce into the plugin, but you could certainly edit your copy to work that way. Are you familiar with WP_Query?

    Edit your file and change wp_dropdown_categories() on line 92 to a plain text input field where you can enter category IDs separated by commas. (Or, if you want to get fancy, write a loop that prints a checkbox for each category, then edit line 64 -- $instance['cat'] = $new_instance['cat']; to implode the resulting array into a comma-separated list.)

    And change its name so you don't get notified about automatic updates, which would overwrite your changes.

  3. Brin Wilson
    Member
    Posted 1 year ago #

    Thank you very much for your reply - I really appreciate it! One other thing, if you don't mind, rather than have the random posts appear in the sidebar, I'd like them to appear in the middle of a specific page, is there an easy way to achieve this? I'm created a new page template in TwentyEleven but I'm really not sure what to write to make the plugin appear... help?

    Best,
    Brin

  4. AviBadash
    Member
    Posted 1 year ago #

    Hello,
    I also need the sane thing like Brin:
    " I'd like them to appear in the middle of a specific page"
    There is any possibility to make a short code for this plug ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic