Title: Integrate WordPress with PHP Website
Last modified: August 19, 2016

---

# Integrate WordPress with PHP Website

 *  840256
 * [17 years, 10 months ago](https://wordpress.org/support/topic/integrate-wordpress-with-php-website/)
 * Hi,
 * I just started a new blog, and I’m trying to integrate it into my existing website.
   I followed the instructions at [http://moshublog.com/2005/07/05/integrate/2/](http://moshublog.com/2005/07/05/integrate/2/)
 * So I have
 * > `<html>
   >  < ?php require(‘../wordpress/wp-blog-header.php’); ?> <head>`
 * Then I have the page formatting and the loop
 * > `<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
   > <?php the_date(”,'<h2>’,'</h2>’); ?>
   > <div class=”post” id=”post-<?php the_ID(); ?>”>
   >  <h3 class=”storytitle”>” rel
   > =”bookmark”><?php the_title(); ?>
   > </h3>
   >  <div class=”meta”><?php _e(“Filed 
   > under:”); ?> <?php the_category(‘,’) ?> — <?php the_author() ?> @ <?php the_time()?
   > > <?php edit_post_link(__(‘Edit This’)); ?></div>
   >  <div class=”storycontent”>
   >  <?php the_content(__(‘(more…)’)); ?> </div>
   >  <div class=”feedback”>
   >  <?php wp_link_pages(); ?> <?php comments_popup_link(
   > __(‘Comments (0)’), __(‘Comments (1)’), __(‘Comments (%)’)); ?> </div>
   > </div>
   > <?php comments_template(); // Get wp-comments.php template ?>
   > <?php endwhile; else: ?>
   >  <p><?php _e(‘Sorry, no posts matched your criteria.’);?
   > ></p> <?php endif; ?>`
 * I get an error message on my site:
 * > Fatal error: Call to undefined function have_posts() in /xxx/xxxxxx.com/x/x/
   > x/xxxxxx/xxxxx/blog/index.php on line 30
 * That line is the first line of the loop `<?php if (have_posts()) : while (have_posts()):
   the_post(); ?>`
 * Can anyone help me fix this?
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Thread Starter 840256
 * [17 years, 10 months ago](https://wordpress.org/support/topic/integrate-wordpress-with-php-website/#post-827471)
 * Oh, and it’s not like I don’t have any posts already–I made two posts to test
   it out.

Viewing 1 replies (of 1 total)

The topic ‘Integrate WordPress with PHP Website’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: 840256
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/integrate-wordpress-with-php-website/#post-827471)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
