Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Magi1053

    (@magi1053)

    Associations and Relationships return an array of Post/Term IDs. If you are only selecting one item in the association, you can simply do carbon_get_post_meta(get_the_ID(), 'my_association_field')[0] to get the first (only) element in the array, otherwise if you would like to display all of the categories, you could put them inside of a foreach loop, for example:

    foreach ( carbon_get_post_meta( get_the_ID(), 'my_association_field' ) as $category ) :
        $query = new WP_Query( array( 'cat' => $category->ID ) );
        if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
            // All posts with this category
        endwhile; endif;
    endforeach;

    Please note that this code is untested
    If you just wanted to get the category itself, you could use the function get_the_category_by_ID( int $cat_ID )

    • This reply was modified 8 years ago by Magi1053.
    • This reply was modified 8 years ago by Magi1053.
    • This reply was modified 8 years ago by Magi1053.

    The plugin does not update the Activity page, the Groups page, comments, and maybe a few others. On the Activity page, Members page, and the Group page it displays this huge error in the title bar. The only page that appears to update is the profile page, members page, and the post author. The comments do update, but not on the sidebar under recent comments. 9 months since this post was made and it has still not been fixed..

Viewing 2 replies - 1 through 2 (of 2 total)