WordPress.org

Forums

Displaying my Blog on the html side of my website (5 posts)

  1. eXtremeSuper
    Member
    Posted 8 years ago #

    I know this question has probably been asked 1000 times on this support blog, but I must just be missing it. Here it goes,

    I have a website, which also has a WordPress blog setup on the same server, it works perfectly. On the website side (html) I would like to put up a display showing my recent postings of the blog.
    What is the easiest way to do this? Easiest?

    If anyone can help it would be tremendously appreciated.

    Thanks,
    Jim (www.eXtremeSuper.com)

  2. moshu
    Member
    Posted 8 years ago #

    On a html file it will be a PITA...
    Can you change/rename it to .php?

  3. kickass
    Member
    Posted 8 years ago #

    Put this at the very top of the html file (adjust path to point at your wordpress installation)--

    <?php
    require_once("wordpress/wp-blog-header.php");
    define('WP_USE_THEMES', false);
    ?>

    Then put this in your side column, where you want the most recent post titles to be listed--

    <?php wp_get_archives('type=postbypost&limit=5'); ?>

    You can change that 5 to however many post titles you want to show.

    Now, in your .htaccess file in the directory where the html file resides you put--

    AddType application/x-httpd-php htm html php
    AddHandler application/x-httpd-php .htm .html

    Voila!

  4. Annica
    Member
    Posted 8 years ago #

    I had the same question as Moshu, so I tried the steps you outline but I get this message:

    Fatal error: Call to undefine\function wp_get_archives()

    Any idea what I nned to do is greatly appreciated.

  5. skulled
    Member
    Posted 8 years ago #

    If you are getting a undefined function it means, you blog files aren't getting called for some reason.

    Where do you have this running and not working? Can you provide the link to it?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags