How to Make a WordPress Theme


If you don’t want templates for your WordPress or if you want your site to be all-original, here’s a simple tutorial on how to make a WordPress theme on your own. If you get real good at this, you should be able to create lots of temples for the other bloggers to use.

These are the simplest steps that you need to do to make a WordPress theme. What we’re going to create is a basic theme sans the advanced features.

1. Define the style.css file.

This file contains all the details pertaining to the WordPress theme that you’re making. Open a notepad and copy and paste this code:

/*
Theme Name: Simple WordPress Layout
Theme URI: http://www.yourdomain.com/
Description: A basic WordPress Layout for novice theme makers.
Author: Your Name
Author URI: http://yoururl.com
Version: 1.0
.
General comments/License Statement if any.
.
*/

2. Open an existing WordPress style.css file and use it as a template. To make everything simple, just copy the rest of the code in there, add the script above, and save everything as style.css

3. Make the header.php

The header is the top part of your WordPress theme. It will display at all times, regardless what link your visitor has clicked. Here’s a code that you can use for the header:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” <?php language_attributes(); ?>>
<head profile=”http://gmpg.org/xfn/11″>
<meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />
<title> <?php simple_title(‘-’); ?> <?php bloginfo(‘name’); ?> </title>
<meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” /> <!– leave this for stats –>
<link rel=”stylesheet” href=”<?php bloginfo(’stylesheet_url’); ?>” type=”text/css” media=”screen” />
<link rel=”alternate” type=”application/rss+xml” title=”<?php bloginfo(‘name’); ?> RSS Feed” href=”<?php bloginfo(‘rss2_url’); ?>” />
<link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
<?php wp_head(); ?>
</head>
<body>
<div id=”mainContainer”>
<div id=”header”></div>

4. Save the file as header.php
5. Create the index.php file.
The index.php file is the core file of your WordPress theme. This is where the content or posts will be called. Here’s a template:

<div id=”content”>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2><a href=”<?php the_permalink() ?>”><?php the_title(); ?></a></h2>

<?php the_content(); ?>

<p><?php the_time(‘F j, Y’); ?> at <?php the_time(‘g:i a’); ?> | <?php the_category(‘, ’); ?> | <?php comments_number(‘No comment’, ’1 comment’, ’% comments’); ?></p>

<?php endwhile; else: ?>

<h2>Sorry…</h2>

<p>No posts we’re found.</p>

<?php endif; ?>

<p align=”center”><?php posts_nav_link(); ?></p>

</div>

5. Make the footer.php file.
The footer would appear at the lower part of the page. Just like the header, it would appear all the time in your WordPress blog.

<br id=”clear” />
<div id=”footer”>
<p>Thanks for the visit! Come back again anytime! Have questions? <a href=”http://yourdomain.com/contact”>Contact me</a> :) .</p>
</div>
</div> <!– Main Container Ends –>
<?php wp_footer(); ?>
</body>
</html>

6. Save this as footer.php
7. You’re done. Just compile the files together and upload it on the theme folder for WordPress.
This one is an imageless, basic WordPress theme. It doesn’t contain sidebars, a single.php code, or a comment box. If you want to add images and more functionality to your site, please consult and advanced WordPress theme creator guide.

AndysWebTools...Easy as Pie! AndysWebTools...Easy as Pie!