0

I have a site that is done in HTML/PHP, mostly using static .html files.

I added a blog, and would like to grab the posts from it to display in the sidebar of the homepage.

I've followed this guide to do so.

The problem is its not working, and I'm not 100% certain if the correct wordpress file is being pointed to.

The blog is kept in a directory called wordpress. So my statement looks like this: require('wordpress/wp-blog-header.php');

Is there something wrong with this? Is there a way to check using chrome if the file has been found / loaded?

Thanks

user974703
  • 1,653
  • 4
  • 20
  • 27
  • what type of file is your home page? – Daniel A. White Dec 19 '11 at 20:11
  • 1
    You won't be able to do this on a "static html" page. What does your file look like? – nachito Dec 19 '11 at 20:12
  • ah, maybe thats the problem. I have it set as .html, I'll try changing the extension. – user974703 Dec 19 '11 at 20:20
  • and indeed, that was it. I knew i was forgetting something. Thanks for the sanity check. – user974703 Dec 19 '11 at 20:21
  • Just a clarification, you can also adjust your apache config file (or htaccess file) go parse html files as if they were php files. And if you didn't want to go this route, but you wanted to keep the .html extension, you could use an iframe OR use javascript/ajax to load the content into an empty element on the page – Ben D Dec 19 '11 at 21:35

1 Answers1

0

If you intend on sticking solely to static HTML pages, the tutorial you mentioned will not help you. Your only option here is to fetch your blog posts from an RSS feed or a JSON feed using JavaScript. I would go for the latter since it's easier to deal with (especially if you utilise jQuery).

Here's a few things for you to check out or read up on:

http://wordpress.org/extend/plugins/json-api/

http://api.jquery.com/jQuery.getJSON/

Parse RSS with jQuery

Community
  • 1
  • 1
Ian
  • 685
  • 7
  • 18