How to Display Any RSS Feed on Your WordPress Blog

<h2><?php _e( ‘Recent news from Some-Other Blog:’, ‘my-text-domain’ ); ?></h2>

<?php // Get RSS Feed(s)
include_once( ABSPATH . WPINC . ‘/feed.php’ );

// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed( ‘http://www.wpbeginner.com/feed/’ );

if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly

// Figure out how many total items there are, but limit it to 5.
$maxitems = $rss->get_item_quantity( 5 );

// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items( 0, $maxitems );

endif;
?>

<ul>
<?php if ( $maxitems == 0 ) : ?>
<li><?php _e( ‘No items’, ‘my-text-domain’ ); ?></li>
<?php else : ?>
<?php // Loop through each feed item and display each item as a hyperlink. ?>
<?php foreach ( $rss_items as $item ) : ?>
<li>
<a href=”<?php echo esc_url( $item->get_permalink() ); ?>”
title=”<?php printf( __( ‘Posted %s’, ‘my-text-domain’ ), $item->get_date(‘j F Y | g:i a’) ); ?>”>
<?php echo esc_html( $item->get_title() ); ?>
</a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>

 

FOR MORE DETAILS:  Click here…!!!

Check has post next and previous link

<?php
$previous_post = get_adjacent_post(false, '', true);
$next_post = get_adjacent_post(false, '', false);
?>
<ul>
<?php if ($previous_post): // if there are older articles ?>
    <li class="prev">Previous post: <a href="<?php echo make_href_root_relative(get_permalink($previous_post)); ?>"><?php echo get_the_title($previous_post); ?></a></li>
<?php endif; ?>
<?php if ($next_post): // if there are newer articles ?>
    <li class="next">Next post: <a href="<?php echo make_href_root_relative(get_permalink($next_post)); ?>"><?php echo get_the_title($next_post); ?></a></li>
<?php endif; ?>
</ul>

How to Exclude Sticky Posts from the Loop in WordPress

How to take away the Sticky Ability of the Post

When you are displaying most recent posts in a tab, you do not want the sticky posts to stay sticky. If you do not remove the sticky features, the recent posts area would be useless as all of your sticky posts will crowd this area. This is when query_posts feature comes in handy.

To do this you will need to change your loop to something like this:

<?php
query_posts(‘caller_get_posts=1’);
if ( have_posts() ) : while ( have_posts() ) : the_post();
?>

Completely exclude Sticky posts from the Loop

If you are using Sticky posts in a slider, then sometimes you might want to completely exclude your sticky posts from the loop. All what you have to do is edit your custom loop to match with this:

<?php
query_posts(array(“post__not_in” =>get_option(“sticky_posts”)));
if ( have_posts() ) : while ( have_posts() ) : the_post();
?>

This code will not display any sticky posts in the post loop.

get_posts() with Taxonomy

$args = array(
‘post_type’ => ‘POST_TYPE’,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘TAXONOMY_NAME’,
‘field’ => ‘slug’,
‘terms’ => array( ‘YOUR_TERMS’ ),
‘operator’ => ‘AND’
)
)
);
get_posts( $args );

for more information refer the link http://codex.wordpress.org/Function_Reference/WP_Query#Taxonomy_Parameters

How to create posts under the post

I have created plugin to create a post under the post but this will work only with custom post type and custom taxonomy what i have created with this plugin. Plugin url wordpress.org/plugins/add-sub-posts