Support

Account

Home Forums General Issues Relationship – Add categories / taxonomies to list

Solving

Relationship – Add categories / taxonomies to list

    • RichB

    • August 9, 2013 at 1:28 am

    Hi, I was wondering if anyone has ever done this before or needed something similar.

    Currently using the relationship field to output a slider and my client would like to start adding categories to the slider as well as pages and posts.

    I could just add a taxonomy field but the disadvantage would be that the user would no longer be able to drag and drop the ‘slides’ into order and would have to work across two fields rather than one.

    Is there a way to hook into the relationship field to allow this? There are a few tutorials about hooks but they are more about filtering.

    Have added a screenshot of what I am hoping to achieve.

    relationship field

    • Elliot

    • August 12, 2013 at 12:06 pm

    Hi @richb

    Thanks for the screenshot.

    Adding a select for the taxonomy is on the to-do and you can expect to see it soon.

    ACF contains a filter which you can use to modify the WP_Query args and filter the posts. You can read more here:
    http://www.advancedcustomfields.com/resources/tutorials/customize-the-relationship-field-list-query/

    • ceebeez

    • September 20, 2013 at 10:48 am

    +1 for this feature to be added.

    I’m looking to get a list of all Tags in a Relationship-style of field, where the chosen list of tags can then be reordered, as we can with Posts currently.

    Like RichB, the Taxonomy checklist/multiple select only gets me half way there.

    I’ve been playing with the code in the link you provided Elliot but I am not having much luck so far.

    Fingers crossed this will be added soon!

    • bk

    • April 23, 2014 at 8:01 pm

    Any word on this one? It’s exactly what I need for an upcoming project. Relationship-style field for tags.

    • ceebeez

    • April 24, 2014 at 3:35 am

    For what it’s worth, I ended up using a Taxonomy ‘post_tag’ field in a Repeater to achieve what I was looking for.

  • +1 for this feature, I need to generate a relationship to a taxonomy.

  • Any news on this features?

    • stiand

    • June 9, 2016 at 6:25 pm

    +1

  • Hi guys i have a similar problem. I have a CPT with a relationship to pages. But the CPT has also various taxanomies. So I need the Output loop to list the relationship items to the taxonomies.

    $posts = get_posts(array(
    	'posts_per_page'	=> -1,
    	'post_type'			=> 'materialien',
        'order'           => 'ASC', 
    	'category'        => 'medienform',
    	'include'         => '',
        'exclude'         => '', 
    	'key' => 'post-relationship',
        'orderby'         => 'post_date', 
    	'meta_query' => array(
    				array(							
                        'key' => 'post-relationship', // name of custom field
    					'value' => '"' . get_the_ID() . '"', // matches exactly "123", not just 123. This prevents a match for "1234"
    					'compare' => 'LIKE'
    				)
    			),
Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.