Class RelatedWordPress

Should I use WordPress or HTML?

Posted

Creating a new website: Should you use WordPress or HTML?

WordPress has been in the news a lot lately. We often see statistics explaining how many of the top web sites are based on WordPress. There’s a reason–it’s really a great tool. However a few people disagree and suggest coding by hand using HTML. Which approach is best?

It depends!

Use WordPress

If you’re creating a personal website, a true blog, or a website for a small company, then definitely consider WordPress. It’s a fantastic easy to use tool. There are literally millions of themes and plugins available–you can change the appearance and add functionality with ease. Best of all, it’s super easy to use!

That ease of use is critical–why should a client pay you (the developer) to add announcements or make other minor updates? WordPress makes this easy.

You can even convert WordPress to a shopping cart–with just a few clicks!

However, there is a downside to using WordPress.  You can spend forever selecting just the right theme (free or premium)–only to find that other people (probably LOTS of other people) are already using it. The only way around this is creating your own theme or paying a developer to create a theme for you. If you’re not comfortable with php, you probably don’t want to create your own themes.

Don’t Use WordPress

If the site you are creating needs to be unique, definitely consider coding with HTML rather than using WordPress. You have total control over the website’s appearance and you can easily incorporate the client’s personality (or your own).  Creating websites this way showcases creativity.

Of course, more work may be involved in the creation and maintenance of an HTML-based site.

Use a Hybrid Design

What if we could have the best of both worlds? Is it possible to create a unique, hand-coded website that integrates all the benefits of WordPress? Yes! It’s actually very easy to create a hybrid design. The website and WordPress blog should be hosted on the same server (preferably in the same account). WordPress must be installed in a different directory (personally I like to install WordPress in a subdirectory). Create your website just like always, but include one extra page. This page will display posts from WordPress.

The page on which you’d like to display your WordPress posts must be a php file. You’ll need to include a little bit of php code. It’s quite simple–you can find it online in a number of places (try www.wordpress.org for starters–or see a sample of the code below). After you create this page, treat it like any other page within your website. Of course you’ll have to customize the code a bit–at the minimum you’ll need to specify the path to WordPress–specifically to the wp-blog-header.php file.

To use it, simply go to the blog and publish a new post. The php code within your website will extract the post from WordPress and display it within your website. Done!

 

 The Code (I did NOT write this–most of this code came directly from the WordPress site!)

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>

<head>
<meta content=”text/html; charset=utf-8″ http-equiv=”Content-Type” />
<title>Blog</title>
<?php
/* Short and sweet */
define(‘WP_USE_THEMES’, false);
require(‘./blog/wp-blog-header.php’);
?>
</head>

<body>

<?php require(‘./blog/wp-blog-header.php’);
?>
<?php query_posts(‘showposts=3’); ?>
<?php while (have_posts()) : the_post(); ?>
<strong><?php the_date(); ?></strong><br />
<a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a><br />
<?php the_content(‘Read more…’); ?>
<hr />
<?php endwhile;?>
</body>

</html>