I recently tried to integrate a WP blog into an existing website. I used the twenty ten default theme as my template. Here is an abreviated list of the steps I took:
- take a sample page from the website
- take out everything that makes up the header and save as header.php
- do the same for the footer
- take out what you don’t need from what’s left and insert the loop
I’ve got the blog working, but when I was trying to modify the style sheet none of the changes I mage had any impact. After several days of tinkering I discovered that the blog is not accessing the style sheet at all. I can delete everything from the style sheet except the opening php that WP needs and the blog still works using whatever styles it gets from my website’s main stylesheet. If I change the font color or size in my website’s style sheet the fonts change in the blog.
I tried linking the style sheet to the header.php but that didn’t work. I’m hoping that someone here has some suggestions. About the only thing I could think of was to copy the styles that I need from the style.css and copy them into my website’s css file.
I’ve reviewed the Codex and unfortunately it is severely lacking in the area of blog integration. The section concerning creating a new theme contains just one paragraph about using the HTML base command, which I used. The base command is not helping me with the style.css problem. It helped me with my other style sheets and images and menus, but I’m still stuck with WP using my site’s style sheet in lieu of style.css.
Unless someone on this forum can offer any help, I’ll just have to continue playing around until I come up with a solution.
After five hours of tinkering I found out what the problem was. My simplified blog integration apparently left out some crucial php that was needed in the header.php.
Here’s the code that got the style sheet back:
<meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
<link rel=”profile” href=”http://gmpg.org/xfn/11″ /> (I’m not sure if this line was needed or not)
<link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘stylesheet_url’ ); ?>” />
Once I inserted that code back into the header.php file it recognized style.css and I was able to modify to my heart’s content.
Here is the final completed blog integration with modified styles.
I still have one nagging problem that I haven’t narrowed down. If you look just above the menu on the left, right above home, there is a one pixel gap between the menu and the image above. You have to select one of the main pages of the site to see what it’s supposed to look like. I’m pretty sure that the style.css is putting a one pixel border around the page or at the top of the page, but I haven’t been able to pin point it.
- The topic ‘Integrated blog not using style.css’ is closed to new replies.