Problems with embedded wordpress
-
I’m trying to embedd WordPress in a existing webpage, and have done so without any problems using the following loop:
<?php
define(‘WP_USE_THEMES’, false); // this disables the WordPress themes
require_once(‘wp-blog-header.php’); // be sure to change “./blog” to the correct path!
?>and
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!– If the post is in the category we want to exclude, we simply pass to the next post. –>
<?php if (in_category(‘3’)) continue; ?>
<div class=”post”>
<h2>“><?php the_title(); ?></h2>
<small><?php the_time(‘F jS, Y’); ?></small>
<div class=”entry”>
<?php the_content(); ?>
</div>
“>Comments to this post
<!– forward or backwards –>
<?php posts_nav_link(‘separator’, ‘prelabel’, ‘nextlabel’); ?></div> <!– closes the first div box –>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>The posts are presented properly, but if I want to leave a comment I am redirected to the default theme! How can I change this so that the comments-box is presented with the same layout as the rest of the page?
Many thanks for all useful tips!
The topic ‘Problems with embedded wordpress’ is closed to new replies.