Tuesday, March 12, 2013

How to create a wp theme

In this tutorial, we will apprentice how to accomplish our own acknowledging WordPress affair application Bootstrap. Bootstrap is a acknowledging framework for architecture web sites and applications, and it's a abundant starting point for architecture a acknowledging WordPress theme.

You don't accept to accept congenital a affair from blemish afore to auspiciously chase along. However, we do accept that you are adequate accomplishing things like abacus and alteration posts in the admin breadth or installing plugins.

The affair we will body is based on the Basic business website archetype you can acquisition over on the Bootstrap examples page. For this audience we will body out templates for the afterward pages and functionality:

  • Custom homepage design
  • About page
  • Contact page
  • News area with comments
  • A widgetized sidebar
  • Getting Started
Before we get started there are a few things you will charge to do:
Install WordPress
Download and Unzip Bootstrap
Install the Affair Test Drive plugin*
* You alone charge this plugin if you will be architecture the affair application a reside website and don't wish humans to see the new affair while you are developing it.

Once you accept these things ready, accessible the agenda with all your WordPress files and cross to wp-content > themes.

Once you cross to that binder actualize a new binder alleged “wpbootstrap.” Inside of that binder adhesive in the bootstrap folder.

Inside of that binder actualize a new book called index.php.

Now we're traveling to archetype the antecedent cipher from the archetype basal business website and archetype and adhesive it into the index.php file. Actuality is the antecedent cipher you wish to use. We've just affiliated to a txt adaptation of the cipher back it is too continued to bury in the column here.

Now that we accept a changeless HTML page, we're traveling to move on to creating the capital CSS page. WordPress requires a distinctively formatted animadversion to arise at the top of the style.css page. It uses this animadversion to get all of the meta advice about your theme.

In the aforementioned binder as your index.php page actualize a new book called style.css. WordPress requires a CSS book with the specific name style.css, so we can’t name it annihilation abroad or our affair won't work.

Once you accept created a style.css book at the aforementioned akin as your index.php file, add this animadversion to the top.

/*
Theme Name: My Theme
Theme URI: http://wp-tutorials.blogspot.com/
Description: A demo theme
Author: Badsha Mia
Author URI: http://wp-tutorials.blogspot.com/
Version: 1.0
Tags: responsive, white, bootstrap

This simple theme was built using the example Bootstrap theme "Basic marketing site" found on the Bootstrap web site http://twitter.github.com/bootstrap/examples/hero.html
*/

The endure affair we charge to do afore we install and alpha architecture our new affair is to upload an angel that will arise with our affair in the WordPress admin area. This angel needs to be 300 x 225 px and called "screenshot.png" You can use this angel or actualize your own.

We're now accessible to go into the admin breadth and install our new theme. Login to the admin breadth and go to Appearances > Theme. You should see WP Bootstrap listed as one of the themes.
It’s bright that none of the CSS is alive on this website currently, so in the next footfall we’ll alpha the action of converting this changeless book into a alive WordPress theme.


Most WordPress capacity cover the afterward files:
index.php
style.css
header.php
footer.php
sidebar.php

You will usually see a lot added than these files, but we're traveling to alpha with these files and body from there. Go advanced actualize abandoned files for the header.php, footer.php, and sidebar.php.
What we are traveling to do is yield all of the HTML that would usually be included at the top of every page and cut and adhesive it into the header.php file. Then we will do the aforementioned for all of the HTML that would commonly arise at the basal of every page and cut and adhesive it into the footer.php file.

Let's attending at what anniversary of these files attending like now. Again these are just .txt files that accept been affiliated to because all of the antecedent cipher would be too abundant to account here. You can archetype and adhesive the cipher from these files into your own .php files.


0 comments:

Post a Comment