I have problem in show tweet in single.php template.

So I use this way to echo the tweet like this :-

$check_embeds=$GLOBALS['wp_embed']->run_shortcode( '[tweet 567061791826382849]' );
echo $check_embeds; 

But not work, But i read https://en.support.wordpress.com/twitter/twitter-embeds/ and put the shortcode like above code but not work.

When i copy this [tweet 567061791826382849] to wp-admin in editor and show post, I can show tweet

Any Solution

  • Are you talking about wordpress.com or .org? – Nilambar Jun 30 '15 at 11:28
  • i have website by using wordpress cms – Zamalek Man Jun 30 '15 at 11:32
  • 1
    When you add full twitter embed URL in editor like https://twitter.com/nacin/status/319508408669708289 WP automatically embeds and displays the tweet. I doubt there is shortcode like [tweet] in default. – Nilambar Jun 30 '15 at 11:56
  • i see my problem in single.php not in editor, i need to add this tweet in code php not in editor :-) – Zamalek Man Jun 30 '15 at 11:57
  • 1
    How about this. echo apply_filters( 'the_content', 'https://twitter.com/nacin/status/319508408669708289' ); – Nilambar Jun 30 '15 at 11:59

You are linking to a support page for wordpress**.com**. While the basic Core WordPress is the same, that is a hosting service and it runs some code that is not part of Core. What you see there may not work on a self-hosted WordPress install. What should work, however, is this:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.