Support

Account

Home Forums General Issues How to show a POST_OBJECT title

Helping

How to show a POST_OBJECT title

  • I am looping through my repeater which works but when I try to output the post_object title, I can’t?!

     while ( have_rows('post_event_conference_streams_repeater') ) : the_row();
                    	
                      // display a sub field value
                      $conf_stream = get_sub_field('conferencestream');
    	                
    									$field = get_sub_field_object('conferencestream');
    										
    									$post_object = get_sub_field_object('conference_streams');
    									
    									if( $post_object ): 
    										echo 'xx';
    										// override $post
    										$post = $post_object;
    										setup_postdata( $post );
    										
    										echo 'Conference Streams: '.get_sub_field('conferencestream');
    										wp_reset_postdata();
    									endif;

    Please help

  • Hi @jarv81178

    You need to use this code <?php the_title(); ?> to show the post object title. It should be like this:

    if( $post_object ): 
        echo 'xx';
        // override $post
        $post = $post_object;
        setup_postdata( $post );
        the_title();
        echo 'Conference Streams: '.get_sub_field('conferencestream');
        wp_reset_postdata();
    endif;

    Also, please make sure that you set the “Select multiple values?” option to “No”.

    I hope this helps.

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

The topic ‘How to show a POST_OBJECT title’ is closed to new replies.