Jump to content


Photo

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


  • Please log in to reply
No replies to this topic

#1 dil_bert

dil_bert
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts

Posted 25 June 2017 - 03:49 PM

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&#8230;"
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.co...cheat_sheet.pdf
 

love to hear from you

 

greetings






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users