Docs    Twitter    Documentation

How Do I Embed the X (formerly Twitter) Feed Directly into a Theme Template?

How to embed an X (Twitter) feed straight into a theme template with do_shortcode, including dynamic feeds.

You can embed the feed directly into a template file by using the WordPress do_shortcode function:

<?php echo do_shortcode('[[custom-twitter-feeds feed=1]]'); ?>

This can also allow you to create dynamic feeds in a template. For example, a profile page for your users where the Twitter handle is saved in user meta:

$handle = example_get_twitter_handle();
<?php echo do_shortcode('[[custom-twitter-feeds screenname="' . $handle .'"]]'); ?>
support

Couldn’t find your answer in the docs?

Contact Support