WordPress.org

Forums

Get all posts(attachments) by custom taxonomy - term (2 posts)

  1. alexelabiz
    Member
    Posted 1 year ago #

    Hi,
    I want to make custom taxonomy (gallery) and terms (name1, name2, name3...)
    Add images into media tab and then retrieve all images from same term.
    Look like simple task, but i cant menage it.

    I registered new (custom) tax added some terms to image, but i cannot retrieve any of them.
    Searched for two days for solution, just can't put all pieces all together.

    Little help more than appreciated.
    Thanks

  2. Hakkim P Ahammed
    Member
    Posted 1 year ago #

    Try this,

    $args = array(
    	'post_type'=> 'YOUR_POST_TYPE',
    	'gallery'    => 'name1, name2,name3',
    	'order'    => 'ASC'
    );
    query_posts( $args );

    After this, use WP loop to fetch post data.

Topic Closed

This topic has been closed to new replies.

About this Topic