How to Display any External RSS Feed on Your Site

Have you seen other bloggers who display their other blog’s feed on their site. You want to do it too for extra promotion and traffic. Well here is the tutorial for you. Simply paste the following code in anywhere in your theme:

01<?php include_once(ABSPATH.WPINC.'/feed.php');
02$rss = fetch_feed('http://feeds.feedburner.com/wpbeginner');
03$maxitems = $rss->get_item_quantity(5);
04$rss_items = $rss->get_items(0, $maxitems);
07<?php if ($maxitems == 0) echo '<li>No items.</li>';
09// Loop through each feed item and display each item as a hyperlink.
10foreach ( $rss_items as $item ) : ?>
12<a href='<?php echo $item->get_permalink(); ?>'
13title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
14<?php echo $item->get_title(); ?></a>
16<?php endforeach; ?>

4. How to Display Relative Dates in WordPress


Have you ever seen this in blog posts and comments and wondered how did this blogger manage to do this? Actually it is pretty easy.

You would need to download a plugin called WP-Relative Date

Once you have downloaded and activated the plugin, look in your single.php, index.php, and page.php for this code:

1<?php the_date(); ?>

Replace it with:

1<?php relative_post_the_date(); ?>

Mostakim Hossen

I am Mostakim Hossain, a Web designer and developer, 23 years of age. I have been working as a freelance (upwork) for almost 2 years now and I will be glad in helping you create your next awesome project.

I have created lots of public and private websites(some shown below) and always looking for more work to learn from. I am using PHP as my primary programming language. You can see my skill set beside this text.

I am a person who is willing to learn and adapts quickly. I am keen to design and security. I believe in the core principles of Open Source and support it. I have a minimalist approach to design and usability. Simplicity is beauty they say.
Masters of Accountancy : Asian University of Bangladesh
I’m here to answer any questions you might have about our products and services. Feel free to contact me using any of the following methods:

Email : support@smarterdevs.com

Leave a Reply

Your email address will not be published. Required fields are marked *


Coupon : happynewyear

60% OFF

Stay updated with all latest updates,upcoming plugins & much more.
WordPress Themes