Advertisement
ridgey28

Simplepie RSS Snippet - Manually Create Blog Name by URL

Jun 3rd, 2015
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php  
  2. /*Simplepie Snippet to manually add Blog Names by URL, where alternative methods don't work, in Display WordPress Posts on another WordPress Blog
  3. -https://www.worldoweb.co.uk/2012/display-wordpress-posts-on-another-wp-blog
  4. */
  5.  
  6. $my_blog_url = $item->get_base();
  7.  
  8.     if($my_blog_url == "http://mywebsite.com/"){
  9.         $title = "My Website";
  10.     }
  11.  
  12.     if ($my_blog_url == "http://mysecondwebsite.com/"){
  13.         $title = 'My Second Website';
  14.     }
  15.     ?>
  16.  
  17.         //echo results
  18.         <span><?php echo $title; ?></span>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement