• Hi guys,

    I 2010 has begun brilliantly for you all.

    I currently have a blog which is in boring old HTML format and I’ve only recently cottoned on to WordPress. I installed it to my web server and unfortunately I’m having some difficulty sorting out my theme.

    One of my current blog posts, for example, looks like this. What I’d like to do is get WordPress to display that exact same theme, keeping with the rest of my site. So basically I’d like the page to look exactly how it does at the moment, except with WordPress facilities like the commenting.

    I messed around a little bit and have so far gotten my WordPress to look like this, which is of course far from ideal!

    Is what I want to do even possible? If so, how would I best go about it? Any suggestions would be greatly appreciated 🙂

    Cheers,

    Dan

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ok. Its actually not too complicated of a conversion. You just need a push in the right direction.

    Open up the html source of your current site. Now, I’m assuming that everything up until div id="main_content" is going to be the same on every page and that everything after div id="main_content" is going to be the same. Even if those assumption are wrong the following should give you the right idea.

    1. In your theme folder, create a new folder named “schaumann_theme” or whatever you want.
    2. Copy the html from your existing site from the top to div id="main_content", paste that into a new file named header.php, and save it to the theme directory you just created.
    3. Do the same with everything below div id="main_content" but save it as footer.php.
    4. Now copy div id="main_content" and save it as index.php in your new theme folder.
    5. Copy your stylesheet into the new theme folder but you need to add some identifying information to the top of the file as explained here.

    You should now be able to activate the theme and have a site that looks much like, maybe not exactly like, the site you have now (but of course without any dynamic functions). That comes now.

    1. Add <?php wp_head(); ?> right before the </head> in your header.php file.
    2. Make sure your <body> tag looks like this:<body <?php body_class(); ?>>— well, you don’t really have to do that but it makes some CSS very convenient.
    3. You might want to widgetize the little navigation section, but maybe not.
    4. You definitely need to do is convert the static html inside div id="main_content" into a Loop. If you look in the default theme you’ll see a line that reads <?php if (have_posts()) : ?>. That and everything through <?php endif; ?> is the Loop in the default theme. You can copy that into your div id="main_content" and get a start. You’ll have to modify the formatting.
    5. Add <?php get_footer(); ?> to the end of your index.php file.

    That should get you started but there are lots and lots of little functions that I haven’t mentioned so don’t think this is a comprehensive tutorial. I’m kind-of assuming that you have some familiarity with PHP and understand opening and closing tags and such. Also, relative links are very unreliable inside a WP theme. It has to do with the virtual file structure that WP presents to the world. Use the bloginfo() function to create absolute URLs.

    And check back later. I’ve probably forgotten something. I’ll remember or someone else will notice and fill in the blanks.

    Thread Starter schaumann

    (@schaumann)

    Mate, you are a champion, thanks so much for your advice! I do have some understanding of PHP so I should be able to follow your advice pretty well. I’ll give it a go on Monday when I have some time; thanks again!!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Keeping my current blog theme after adding WordPress’ is closed to new replies.