Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Question is simple. Can i get the title and main url of the site from where the posts are loading? Actually i want to linked to the main site.

The url can be found by wordpress function esc_url(); function but what about site title?

The page is here:

http://citystir.com/author/designdons/

Thanks!

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted
$feed = fetch_feed($feedurl);
$channel = $feed->channel;
$blog_title = $channel["title"];

Note - I haven't tested this, am relying on my (faulty) memory.

share|improve this answer
    
Actually i am mixing RSS feeds from couple of sites. So, the site title's are needed in the item lavel. I get the site url via $item->get_base(); Is there any way to find out the title in the simplepie item? I have print_r the simple pie item object. I have seen the site title there but don't know how to get it :( –  Sisir May 6 '11 at 10:00
    
If the site title is there why can't you get it? add the print_r output to your question –  anu May 6 '11 at 10:29
    
Sorry, i don't have too much experience with php objects. Here is the print_r pastebin.com/1C1RAawV look for the text "Lakeview". Did not paste full output.. its too large.. Thanks! –  Sisir May 6 '11 at 10:35
    
Start checking in line 71 you will see the title in line 87 you will see the site url.. Thanks! –  Sisir May 6 '11 at 10:48
    
anything? :( –  Sisir May 7 '11 at 9:50
add comment

I opted for a more simplistic way.

  <?php $title = $item->get_base();

    if($title == "http://mywebsite.com/"){
        $t = "My Website";
    }

        if ($title == "http://mysecondwebsite.com/"){
        $t = 'My Second Website';
    }
    ?>

        //echo results
        <span><?php echo $t; ?></span>

I had tried get_channel_tags and get_feed_tags which always returned NULL

share|improve this answer
    
Site url is arbitrary.. –  Sisir Mar 14 at 14:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.