1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Using the Wordpress Post Title as title of RSS Feed????

Discussion in 'XML & RSS' started by northwest, Feb 22, 2008.

  1. #1
    I want to pass the title (the_title())of the blog post as the query for the rss feed.

    $URL = "http://search.msn.com/news/results.aspxq=credit+card&format=rss&FORM=RSNR";

    In the above, instead of hard coding the word credit+card, I want to pass the title as a parameter.

    So, I tried doing the following and it did not work:

    $keyword = <?php the_title(); ?>;

    $URL = "http://search.msn.com/news/results.aspxq=$keyword&format=rss&FORM=RSNR";

    The following worked:

    $keyword = 'credit+card';
    $URL = "http://search.msn.com/news/results.aspxq=$keyword&format=rss&FORM=RSNR";

    But I want to use the title of the post as a criteria for the rss feeds.

    Any suggestions are greatly appreciated.

    THanks
     
    northwest, Feb 22, 2008 IP
  2. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #2
    The system for displaying latest blogs at DigitalPoint doesn't seem to allow that.

    Mine used to display the title of thje most recent blog post. For the past few months at least, it has stopped doing that and now displays just "Psychlinks Blog", the name of the blog, rather than the most recent post title.

    On other forums using a latest blog feature, it works just fine, so I assume it's an issue with DigitalPoint rather than a general issue.
     
    minstrel, Feb 24, 2008 IP
  3. northwest

    northwest Peon

    Messages:
    277
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Not sure How your response is related to my question....

    I just want keyword of the RSS feed to be the title of the post on which the RSS will be displayed. The title tag is the "the_title" in wordpress. I want the value of "the_title" to be keyword in the rss URL. I was wondering if there are any PHP experts who could tell how to do this...
     
    northwest, Feb 24, 2008 IP
  4. imvain2

    imvain2 Peon

    Messages:
    218
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    it looks like the_title has optional parameters.

    the_title($before = '', $after = '', $echo = true)

    so you could try:

    $keyword = the_title('','',false) ;
    $URL = "http://search.msn.com/news/results.aspxq=$keyword&format=rss&FORM=RSNR";

    I'm not sure if this will work, just noticed the_title function's parameters
     
    imvain2, Feb 24, 2008 IP
  5. kineda

    kineda Peon

    Messages:
    102
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Just use the_title_rss() in your RSS template.
     
    kineda, Feb 26, 2008 IP