Support

Account

Home Forums Front-end Issues Shortcode not working

Solved

Shortcode not working

  • Hy Guys, i´m new to ACF and did not get any output with acf shortcodes.

    for example: [acf field="datum_news"]

    Custom Short Code works:

    
    add_shortcode( 'footag', 'wpdocs_footag_func' );
    function wpdocs_footag_func( $atts ) {
    	return "foo = {$atts['foo']}";
    
    }
    

    Any hints? ACF 6.2.0 and Themify Ultra Theme

    Regards Christian

  • Where are you trying to use the shortcode?

    What type of field is the shortcode?

    Is the field of sub field of another field (group, repeater, flex)?

    Shortcode only works for simple fields that store text values.

    Sortcode only works without supplying post_id when get_queried_object() returns a WP object of Post, Term or User.

    https://www.advancedcustomfields.com/resources/shortcode/

  • Hy Guys,

    Is the field of sub field of another field (group, repeater, flex)?

    Problem was the Group and Subfield. Didnt know about this limitation. For now everything works as expected.

    regards chrsitian

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

You must be logged in to reply to this topic.