• I created a custom post object field.
    The user can make multiple selections.
    I would like to be able to print the values ??in a shortcode. I use the following code:

    function post_selezionti() {
    	$articoli_collegati = get_field('articoli_collegati');
    	if ($articoli_collegati) {
    		echo esc_html('test'.$articoli_collegati->post_title);
    	}
    }
    
    add_shortcode( 'sc_post_selezionti', 'post_selezionti');

    only test appears on the screen.
    How do i view the post title do i have the value of the custom field?
    Thanks

  • The topic ‘post object’ is closed to new replies.