Trying to get WP fully embedded in a custom site

I’m making a website for a friend and am trying to embed a WP blog here:

Catherine & Chloe

The first post is showing up, but there’s no comment function and I don’t know what’s going to happen when there are 10 or 20 posts. I need the blog to be fully operational with comments, archive for old posts, and all the things you normally get with a blog.

I’ve installed WP at Catherine & Chloe | Just another WordPress site - I have tried migrating the custom-designed pages into the /blog/ directory, but every time I save a file as index.html WP overwrites every page in the directory as a copy of index.html, and I mean an exact copy, i.e. the blog disappears. And my friend is adamant that she does not want the whole thing redesigned with WP templates.

So basically, I need a fully-functioning blog in a fully custom-looking site, and I’m stuck on how to do it. Found half an answer here:

which says ‘just take the HTML elements that make up your site’s design and surround the WP code with it.’ Yes, that’s exactly what I want to do, but no idea how to do it. Can anyone help?

How comfortable are you with PHP? You will need to know PHP a decent amount to do this. At the end you will see that WP is not super secret package, just various calls housed in functions.

On the page in question, you will need to create “The Loop” to hook onto WordPress. At the top of the page, put

<?php define('WP_USE_THEMES', false); get_header(); ?>

near the top of the page.
Read: The Loop « WordPress Codex for more info

Thanks rguy84. I don’t really know PHP so have been attempting to figure it out as I go along - I’ve put my website on Wordpress by editing the ‘Starkers’ blank theme into a custom theme. Front page is working nicely:

Catherine & Chloe

The problem is with the other pages.

Catherine & Chloe Blog page - this looked horrendous without formatting so I put in a lot of the code from the 2010 theme on which Starkers was based.

Problem 1 is grey links that turn bright red on mouseover. Can’t find the code that would strip those colours out and make them the same as my other links.

Problem 2 is it still looks a bit half-formatted.

Problem 3 is that the rest of my pages come out like this: Catherine & Chloe no matter what I type in the html box, it doesn’t show up on the page. I’ve tried putting the Loop in the page but that just produces blog posts complete with post-date etc, not usable page text.

Also, pretty permalinks don’t work - I get ‘page not found’ when I try to use them.

Help? This site needs to be done today.

That’s the problem, you kind of need to be comfortable with PHP to do this.

Problem 1- that is a CSS issue. If it happens in the WP part, you will need to go into the theme’s stylesheet and edit the hover class.
Prob 2- you will need to provide more info
Prob 3- There could be a handful of things happening here

The pretty links don’t work due to settings in WP. I am guessing WP is trying to do a url rewrite on your site versus just /blog/

Thanks rguy84. I’ve got nearly everything working now and a busy building the site - the one problem remaining is the blog here:

Catherine & Chloe

The top post (headed ‘Blog’) is static and when I make a new post, it only shows upas a link right at the bottom under ‘Recent posts’. I want to get rid of that static post and have my newest post there instead. Any ideas?

Please post that page’s code inside of [ php ] [/ php] (remove the spaces) so I can see what the code looks like.

Thanks - here you go:

Template Name: Blog

<?php get_header(); ?>

			/* Run the loop to output the posts.
			 * If you want to overload this in a child theme then include a file
			 * called loop-index.php and that will be used instead.
			 get_template_part( 'loop', 'index' );

<?php get_sidebar(); ?>

<?php get_footer(); ?>

Where is the code I posted in reply 2

I thought I shouldn’t put it in bc I am using a theme (my own) - am I wrong?

Still having the same problem with the blog, and also noticed that the individual post pages (linked in the blog) aren’t obeying my font formatting even after I edited it into page.php. Here’s what everything looks like now:


Template Name: Blog

<?php define('WP_USE_THEMES', false); get_header(); ?>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<!-- Display the Title as a link to the Post's permalink. -->
 <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php 

the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

 <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. 

 <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>

 <!-- Display the Post's Content in a div box. -->
 <div class="entry">
   <?php the_content(); ?>

 <!-- Display a comma separated list of the Post's Categories. -->
 <p class="postmetadata">Posted in <?php the_category(', '); ?></p>
 </div> <!-- closes the first div box -->

<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>

<?php get_sidebar(); ?>

<?php get_footer(); ?>


 * The template for displaying all pages.
 * This is the template that displays all pages 

by default.
 * Please note that this is the wordpress construct of pages
 * and that other 'pages' on 

your wordpress site will use a
 * different template.
 * @package WordPress
 * @subpackage Starkers

* @since Starkers 3.0

get_header(); ?>

<?php if ( have_posts() ) while ( have_posts() ) : 

the_post(); ?>

					<?php if ( is_front_page() ) { ?>

						<h2><?php the_title(); ?></h2>

	<?php } else { ?>
<div align="justify">
<font face="Verdana, Arial, Helvetica, sans serif" color="#646462" size="2"><b><?php the_title(); 

					<?php } ?>				


			<?php the_content(); ?>

wp_link_pages( array( 'before' => '' . __( 'Pages:', 'twentyten' ), 'after' => '' ) ); ?>

				<?php edit_post_link( __( 'Edit', 'twentyten' ), '', '' ); ?>


		<?php comments_template( '', true ); ?>

<?php endwhile; ?>

<?php get_sidebar(); ?

<?php get_footer(); ?>

All the rest of the site is built and ready to go live once this is fixed.

I am a bit lost in regards to do. How I originally read your post is that you wanted just the latest x post on a page then have those link to full posts. But if you want it more embedded you will need a handful of customization. In that case it would almost be easier to make WP a CMS versus juggling them seperately.

I just looked at the page again, it looks like you went ahead and made WP a CMS.