Showing my latest blog post title on my homepage

Discussion in 'HTML & Website Design' started by tyzer, Sep 29, 2006.

  1. #1
    Hi,

    I am trying to get my blogs latest posts title to appear on my sites homepage.

    Basically what i want is, everytime i write a new blog post ( i use wordpress), i want a small piece of text saying, 'Latest Blog Post' and then the title of that blog post and if possible the first few words from the post.

    Does anyone know how i would go about doing this?

    Thanks for any help.
     
    tyzer, Sep 29, 2006 IP
  2. bwp58

    bwp58 Peon

    Messages:
    485
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi

    You could use CARP & pull the latest post off your blogs RSS feed.
    the site is here http://www.geckotribe.com/rss/carp/.

    It very configurable. Just set it up to pull the title only off the latest RSS entry.

    Hope this helps
    Regards
    Brian
     
    bwp58, Sep 29, 2006 IP
  3. sawz

    sawz Prominent Member

    Messages:
    8,225
    Likes Received:
    808
    Best Answers:
    0
    Trophy Points:
    360
    #3
    are you able to use SSI?
     
    sawz, Sep 29, 2006 IP
  4. tyzer

    tyzer Well-Known Member

    Messages:
    574
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    105
    Digital Goods:
    2
    #4
    I'm not 100% sure what that is?
     
    tyzer, Sep 30, 2006 IP
  5. thevenerablez

    thevenerablez Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    manually with title tags always works...
     
    thevenerablez, Sep 30, 2006 IP
  6. tyzer

    tyzer Well-Known Member

    Messages:
    574
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    105
    Digital Goods:
    2
    #6
    what do you mean by that? i'm still pretty new to php and editing code.
     
    tyzer, Sep 30, 2006 IP
  7. sawz

    sawz Prominent Member

    Messages:
    8,225
    Likes Received:
    808
    Best Answers:
    0
    Trophy Points:
    360
    #7
    this may be a good place to start.
     
    sawz, Oct 1, 2006 IP
  8. tyzer

    tyzer Well-Known Member

    Messages:
    574
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    105
    Digital Goods:
    2
    #8
    thanks sawz, i'll take a look at that now
     
    tyzer, Oct 1, 2006 IP
  9. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #9
    <?php
    $xml = simplexml_load_file( "your_rss_feed.xml" ) ;
    $blog = $xml->channel;
    $blogEntries = $blog->item;
    echo $blogEntries->title . "\n"; 
    ?>
    PHP:
    Couldn't you just do that?
     
    Gordaen, Oct 2, 2006 IP
  10. tyzer

    tyzer Well-Known Member

    Messages:
    574
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    105
    Digital Goods:
    2
    #10
    sorry for the late reply Gordaen, i'll have a look into that and see if it works.
     
    tyzer, Oct 3, 2006 IP
  11. tyzer

    tyzer Well-Known Member

    Messages:
    574
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    105
    Digital Goods:
    2
    #11
    i tried it gordaen, but i just keep getting this error,

    Fatal error: Call to undefined function: simplexml_load_file() in /home/public_html/testfeed.php on line 10

    this is my feed url, adquick.co.uk/blog/?feed=rss2 and i have just put that where you had this line,

    $xml = simplexml_load_file( "your_rss_feed.xml" )

    i replaced your_rss_feed.xml with http://adquick.co.uk/blog/?feed=rss2

    have i done that right?
     
    tyzer, Oct 3, 2006 IP
  12. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #12
    You need php 5 to use that function if I remember correctly.

     
    jestep, Oct 3, 2006 IP
  13. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #13
    Try this tutorial for PHP4.

    If you have a little php knowledge you should be able to figure it out without oo much difficulty.

    http://www.bmindful.com/api.aspx
     
    jestep, Oct 3, 2006 IP
  14. tyzer

    tyzer Well-Known Member

    Messages:
    574
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    105
    Digital Goods:
    2
    #14
    jestep, thanks for that. i'll have a look at that.
     
    tyzer, Oct 3, 2006 IP
  15. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #15
    You can also use file_get_contents function to read the xml and then get relevant information from there. That's what I have done on my directory . See the update,news,free stuff heading on right side.
    Bye :)
     
    JEET, Oct 3, 2006 IP
  16. tyzer

    tyzer Well-Known Member

    Messages:
    574
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    105
    Digital Goods:
    2
    #16
    Hi Jeet,

    i like the look of what you have done there.

    I am still a beginner when it comes to php and what all these functions mean, so would you be willing to explain in detail what i need to do to copy what you did with the file_get_contents function?

    Thanks Jeet.
     
    tyzer, Oct 3, 2006 IP