• Hi,

    I follow your instruction to add any custom field data to tweet by creating the shortcode. But It didn’t work.

    My code

    add_shortcode( 'headline', 'bnd_headling' );
    
    function bnd_headling(){
      return get_field('subtitle_post',get_the_id());
    }

    Template
    [ [ headline ] ]

    Let me know whats wrong in it.

    PS: The space in shortcode are extra. If posted it without spaces WordPress convert into some link.

    • This topic was modified 6 years, 10 months ago by Burhan Nasir.
    • This topic was modified 6 years, 10 months ago by Burhan Nasir.
    • This topic was modified 6 years, 10 months ago by Burhan Nasir.
    • This topic was modified 6 years, 10 months ago by Burhan Nasir.
Viewing 1 replies (of 1 total)
  • Plugin Author Joe Dolson

    (@joedolson)

    What instructions were you following that said to do that? What you’ve done won’t have any impact on WP to Twitter, although you could render the headline inside a post using [headline] using that code.

    All you need in WP to Twitter is to reference the field name, e.g. [[subtitle_post]]; there’s no extra code involved unless you need to manipulate the value of the field.

    • This reply was modified 6 years, 10 months ago by Joe Dolson.
    • This reply was modified 6 years, 10 months ago by Joe Dolson.
Viewing 1 replies (of 1 total)
  • The topic ‘ACF data in Tweet’ is closed to new replies.