Integrating wordpress into non-wordpress pages

Hi - I’d like to integrate the loop into a non-wordpress page (“nonwp-page.php”) so I can use wp plugins, as per:

http://codex.wordpress.org/Integrating_WordPress_with_Your_Website

The page displays fine with no problem with this inside the tag:

<?php require('../wp-blog-header.php');?>

But then when I add the loop as follows:

<div id="wrapper">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

[content of my nonwp-page.php]

<?php endwhile; endif; ?>
</div><!--wrapper-->
</body>
</html>

I get this error: “Parse error: syntax error, unexpected end of file in c:\path\nonwp-page.php”

Does anyone perhaps know how I can fix this?

thank you, Val

Tracy at http://www.worldoweb.co.uk/ gave me the solution. So I have Ajax testimonials working now perfectly on my non-wordpress pages.

In your non-wordpress page’s html, this must be before doctype:

<?php require '../wp-blog-header.php';?>

This must be last before </head>:

<?php wp_head(); ?><!--enables js+css to load for wp plugins-->

And this must be last before </body>

<?php wp_footer(); ?><!--enables js+css to load for wp plugins-->

The loop isn’t required.

Val

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.