Jump to content

twitter widget plugin - does it run in version WP 4.8 too


Recommended Posts

hello dear community,

 

does this code run in WP 4.8 - love to hear from you



Show Twitter Feed in Loop:
Show a Twitter feed in a custom page template. Make sure to replace USERNAME.rss with your Twitter
handle (keep the .rss as well).
<?php
/****************************CODE-1**************************************
* @Author: Boutros AbiChedid
* @Date: May 30, 2012
* @Websites: bacsoftwareconsulting.com/ ; blueoliveonline.com/
* @Description: Display your Latest tweets (from your Twitter account) on
* your WordPress Blog.
* @Tested on: WordPress version 3.3.2
*************************************************************************/
?>
<?php
//Path to include feed.php file located in wp-includes folder.
include_once(ABSPATH . WPINC . '/feed.php');
//Retrieves the feed and parses it. Specify the feed URL. This is my feed, put yours.
$rss = fetch_feed('http://twitter.com/statuses/user_timeline/USERNAME.rss');
$tweetnumber = 3; /** How many tweets you want to show. Must be >= 1 **/
$maxitems = $rss->get_item_quantity($tweetnumber);
$firstitem = 0; /** Specify the first item. 0 to start from the newest tweet. **/
$rss_items = $rss->get_items($firstitem, $maxitems);
?>
<div class="twitter-list">
<?php
if ($maxitems == 0)
echo '<li>No Tweets Yet!</li>';
else
//Loop through each feed item and display it as a link.
foreach ( $rss_items as $item ) { ?>
<p>
<!-- Get the tweet item title as an external link.-->
<a href='<?php echo $item->get_permalink(); ?>' target="_blank" title="External Link…"
rel="nofollow">
<?php echo $item->get_title(); ?></a> <br />
<!-- Get the tweet item date.-->
<span><?php echo 'Posted: ' . $item->get_date(); ?></span>
</p>
<?php } ?>


found it here:
https://www.karks.com/wp-content/uploads/2012/09/wp_cheat_sheet.pdf
 

love to hear from you

 

greetings

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.