WordPress.org

Forums

Get attachments from posts from given category (1 post)

  1. lupinek
    Member
    Posted 4 years ago #

    I need to get 5 attachments (images) from 5 newest posts from given category ('foobar') in WordPress. At the moment I can do it by calling two functions separately (WP_Query and get_children):

    http://pastebin.com/29kYhg1P

    But I'm looking for simpler solution (maybe with use of wpdb?) Is there any?

Topic Closed

This topic has been closed to new replies.

About this Topic