Coding help! Display latest blog title on homepage :)

Discussion in 'Blogging' started by WiredNode, Jul 15, 2008.

  1. #1
    Hello,

    I have a website page, in PHP.
    Is there a way I can display the title of my latest blog post on that php home page and have a link to it.
    I need it to update everytime something is added to the blog.

    Pleaseeee Help.

    Thanks.
     
    WiredNode, Jul 15, 2008 IP
  2. rohan_shenoy

    rohan_shenoy Active Member

    Messages:
    441
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Do you know simple-XML functions in PHP?
     
    rohan_shenoy, Jul 15, 2008 IP
  3. falguni1

    falguni1 Peon

    Messages:
    3,016
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    0
    #3
    create a widget and put your feed in that widget.
    place that widget in your site.
    you can get the widgets at many blog widget sites.
    http://www.widgetbox.com
     
    falguni1, Jul 15, 2008 IP
  4. WiredNode

    WiredNode Peon

    Messages:
    478
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm not looking to pay for it, was wondering if anyone knew the code to do it.
    Ive seen it on other sites, just wanted to know if anyone else knew it.


    Thanks
     
    WiredNode, Jul 15, 2008 IP
  5. ozan

    ozan Peon

    Messages:
    82
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Your blog presumably has an XML-based RSS feed. If that's the case, you simply need to parse the XML on your other site. If it's on a different domain then this is a little bit trickier, but it's still very straightforward php.

    Try to do it yourself. If you're struggling, poke around in google for a php XML parser. If you're still struggling, ask again and we'll help you out.
     
    ozan, Jul 15, 2008 IP
  6. WiredNode

    WiredNode Peon

    Messages:
    478
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hey,

    Ive had a look on google, but I really dont understand any of it :(
    Can someone please write a small bit of code to point me in the right direction? :S

    Thanks,
    Jonathan
     
    WiredNode, Jul 16, 2008 IP
  7. ozan

    ozan Peon

    Messages:
    82
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Try using Magpie RSS.

    Once you've included the Magpie RSS script, there's a function (fetch_rss($url) from memory) which will return the feed XML as an array.

    It could be more efficient as you only need the title and URL of one post rather than all the data, but this will save you some coding.
     
    ozan, Jul 16, 2008 IP
  8. WiredNode

    WiredNode Peon

    Messages:
    478
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks ozan, got it fixed now :D
     
    WiredNode, Jul 16, 2008 IP
  9. ozan

    ozan Peon

    Messages:
    82
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Glad to hear.
     
    ozan, Jul 16, 2008 IP