Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- SimplePie Wordpress - Display 1 post by filtering it's ID
- [link]http://www.worldoweb.co.uk/2012/display-wordpress-posts-on-another-wp-blog
- */
- ?>
- <ul class="rss-items" id="wow-feed">
- <?php
- if ($maxitems == 0){
- echo '<li>No items.</li>';
- }
- else {
- foreach ($rss_items as $item):
- $id = $item->get_id(); //Get's IDs of posts
- //echo var_dump($id) Uncomment, save and reload to display ID's
- //Replace below with your ID
- if ($id === 'http://www.worldoweb.co.uk/?p=5941') {?>
- <li class="item">
- <span class="rss-image">
- <?php echo '<img src="' . get_first_image_url($item->get_content()) . '"/>';?>
- </span>
- <span class="data">
- <h5>
- <a href='<?php echo esc_url($item->get_permalink());?>'
- title='<?php echo esc_html($item->get_title());?>'>
- <?php echo esc_html($item->get_title());?></a>
- </h5>
- <span class="date-image"> </span>
- <small><?php echo $item->get_date('F Y');?></small>
- <span class="comment-image"> </span>
- <small><?php $comments = $item->
- get_item_tags('http://purl.org/rss/1.0/modules/slash/', 'comments');?>
- <?php $number = $comments[0]['data'];?>
- <?php if ($number == '1') {
- echo $number . " " . "Comment";}
- else {
- echo $number . " " . "Comments";}?>
- </small>
- <p><?php echo $item->get_description();?></p>
- </span>
- </li>
- <?php } //end if?>
- <?php endforeach;?>
- <?php } //end if;?>
- </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement