This plugin will add the PHP class GetTweetsInPhp. You can use this class as described below for retrieving latest tweets from a Twitter account, then handle the tweets as you want in your PHP code.
Note: you should create a Twitter app before using this plugin. You can do it from here: http://apps.twitter.com.
Get and show latest tweets from @netglooweb:
// Set configurations $configs = [ // Set here tokens from your Twitter's app 'consumer_key' => 'CONSUMER_KEY', 'consumer_secret' => 'CONSUMER_SECRET', // The Twitter account name 'screen_name' => 'netglooweb', // The number of tweets 'count' => 5, ]; // Get latest tweets using the function get_tweets $tweets = \Netgloo\GetTweetsInPhp::get_tweets($configs); // ... // For each tweet show the HTML text and the attached image foreach ($tweets as $tweet) { echo "<p>"; echo $tweet->n_html_text; if ($tweet->n_has_media_photo) { echo "<img src='{$tweet->n_media_photo_url}' width='100%' />"; } echo "</p>"; } // ... That’s all! Have fun!
The get_tweets() function takes an array of configurations:
$configs = [ // --- Required --- // The tokens from your Twitter's app 'consumer_key' => '...', 'consumer_secret' => '...', // The Twitter account name 'screen_name' => '...', // --- Optional --- // The number of tweets 'count' => 20, // Include also the retweets 'include_rts' => true, // In the HTML text will be showed "Retweeted by ..." if the tweet // is a retweet 'show_retweeted_by' => true, // Enable the cache // It is recommended to activate the cache, when you put live // your website, in order to avoid to reach the Twitter's api rate // limit of 300 requests / 15-min. 'cache_enabled' => false, // Cache expiration (in seconds) // Increase the value to optimize the website's speed, decrease // the value if you want a more real-time behaviour (but not // less than 4 seconds to avoid to reach the rate limit). 'cache_expiration' => 60, // Templates // Retweeted by text template 'retweeted_by_template' => '<em> Retweeted by {{user_name}}</em>', // Hash tag link template 'hashtag_link_template' => '<a href="{{hashtag_link}}" rel="nofollow" target="_blank">' . '#{{hashtag_text}}</a>', // Url link template 'url_link_template' => '<a href="{{url_link}}" rel="nofollow" target="_blank" ' . 'title="{{url_title}}">{{url_text}}</a>', // User mention link template 'user_mention_link_template' => '<a href="{{user_mention_link}}" rel="nofollow" target="_blank" ' . 'title="{{user_mention_title}}">@{{user_mention_text}}</a>', // Media link template 'media_link_template' => '<a href="{{media_link}}" rel="nofollow" target="_blank" ' . 'title="{{media_title}}">{{media_text}}</a>' ]; $tweets = \Netgloo\GetTweetsInPhp::get_tweets($configs); The get_tweets() function will return an Array of tweets. On each tweet object are available these properties:
Other available properties are those returned from the user_timeline Twitter’s API.
These are some useful ones:
If the properties n_is_retweeted is true the current tweet is a “re-tweet” and the retweeted_status object is available:
Example
This code use some of the above properties:
// ... $tweets = \Netgloo\GetTweetsInPhp::get_tweets($configs); foreach ($tweets as $tweet) { echo $tweet->created_at . "<br/>"; echo $tweet->n_html_text . "<br/>"; if ($tweet->n_has_media_photo) { echo $tweet->n_media_photo_url . "<br/>"; } } // ... Since we rely on the Twitter’s user_timeline API, you should read the following docs for taking in account any API’s limitation:
For patches, bug reports, suggestions, requests for features there is a Git repository on GitHub here:
https://github.com/netgloo/get-tweets-in-php
Starting from $0 per month.
Rating
Reviewers
2 reviews
Tags
Developed By
Netgloo
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Show Vimeo videos in a Vimeo feed that keeps content fresh and helps visitors discover more of your video library.
Add charts and graphs to your site to present data clearly, help visitors understand insights faster, and support more confident decision making.
Use a contact form so visitors can send messages, submit inquiries, and help you collect leads and improve user experience.
Showcase videos with a video carousel that rotates or slides clips, improves visual design, and keeps visitors watching and engaged.
Show Bluesky posts with a Bluesky feed slider that scrolls updates and keeps content visible while keeping visitors engaged.
Show G2 reviews to build trust, strengthen credibility, and help visitors make confident SaaS buying decisions that support higher sales.
Create a mega footer that organizes navigation links, contact info, logos, social icons and improves usability and site structure.
Show Bluesky posts with a Bluesky feed that updates in real time, improves content discovery, and keeps visitors engaged with fresh activity.
Add interactive stories to your site to showcase content in a visual, mobile friendly format that boosts engagement and guides visitors toward action.
Add an interactive before and after slider to your site to show visual transformations, capture attention, and help visitors understand real results.
Create interactive diagrams with a diagrams widget that lets you build and customize flow charts, improve clarity, and help visitors understand complex ideas easily.
Show Instagram posts in a responsive carousel layout to enhance social proof and keep your site content visually fresh.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
