Support » Themes and Templates » Embed Short-code how to use in this case?

  • Resolved jas

    (@jaskaranpreetsingh)


    Hi

    I have made custom short code “[custom_posts type=’tweet’]” and using this in my one of post.

    It results an out put like below:

    [embed]https://twitter.com/fwikingsson/status/616224371993092096[/embed]
    [embed]https://twitter.com/someone/status/631840574266580992[/embed]
    [embed]https://twitter.com/someone/status/631840543023235072[/embed]

    But it did not output like tweet. which means embed is not working.

    If I use https://twitter.com/fwikingsson/status/616224371993092096 in post it outputs like tweet.

    Please suggest, any will be appreciated 🙂

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter jas

    (@jaskaranpreetsingh)

    I found the solution so marking as resolved I was struggling from long time and came to know the class structure of embed code so there was need of global.

    global $wp_embed;
    echo $wp_embed->run_shortcode(‘[embed]‘.$url.’[/embed]‘);

Viewing 1 replies (of 1 total)
  • The topic ‘Embed Short-code how to use in this case?’ is closed to new replies.