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

  1. alexelabiz
    Posted 2 years ago #

    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.

  2. Hakkim P Ahammed
    Posted 2 years 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