Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

What i was doing previously, are as follows -

  1. I copy the wordpress base theme (like twentytwelve in wordpress 3.5)
  2. Rename the folder and converted index.html of my HTML to index.php for wordpress theme.
  3. Replace style.css with my current style.css.

Is it the right way of theme development or some else better technique can be applied for theme development ?

I google a lot for the theme development but 99% tutorials are only using index.php , style.css only(some only header/footer etc) although in the new version of wordpress 3.5 twentytwelve I found there are too many files in the theme.

So for the client case I dont want to leave any core theme functionality provided these dummy themes, so is it the correct way I am following or for the best way I need to design and code for each file ?

share|improve this question
add comment

3 Answers 3

up vote 10 down vote accepted

I like to do this as follows:

  1. Go to underscores.me, fill out the theme name, and download the theme.
  2. Strip out the parts of this (somewhat clean) template that don't want to use.
  3. Start building your own template with the functionality that you wrote.

This way you will have a clean template to start with, and no core theme functionality provided by the theme you decided to use as a dummy.

I don't know exactly if there is any "right" way to build your own theme, only that the Codex insist you use the WordPress Coding Standards, CSS Coding Standards and that you follow the design guidelines.
I think that, except of the parts of the Codex a developer is free in how to develop a theme.

share|improve this answer
3  
+1 for underscores.me :) –  swapnesh Jan 17 '13 at 9:14
add comment

Did you read official codex documentation about theme development?

Anyway here are some points to note

At the very minimum, a WordPress Theme consists of two files:

  1. style.css
  2. index.php

functions.php

A theme can optionally use a functions file, which resides in the theme subdirectory and is named functions.php.

This file basically acts like a plugin, and if it is present in the theme you are using, it is automatically loaded during WordPress initialization (both for admin pages and external pages)

Template Files List

Here is the list of the Theme files recognized by WordPress. Of course, your Theme can contain any other stylesheets, images, or files. Just keep in mind that the following have special meaning to WordPress -- see Template Hierarchy for more information.

style.css

The main stylesheet. This must be included with your Theme, and it must contain the information header for your Theme.

rtl.css

The rtl stylesheet. This will be included automatically if the website's text direction is right-to-left. This can be generated using the the RTLer plugin.

index.php

The main template. If your Theme provides its own templates, index.php must be present.

comments.php

The comments template.

front-page.php

The front page template, it is only used if you use a static front page.

home.php

The home page template, which is the front page by default. If you use a static front page this is the template for the page with the latest posts.

single.php

The single post template. Used when a single post is queried. For this and all other query templates, index.php is used if the query template is not present.

single-.php

The single post template used when a single post from a custom post type is queried. For example, single-books.php would be used for displaying single posts from the custom post type books. index.php is used if the query template for the custom post type is not present.

page.php

The page template. Used when an individual Page is queried.

category.php

The category template. Used when a category is queried.

tag.php

The tag template. Used when a tag is queried.

taxonomy.php

The term template. Used when a term in a custom taxonomy is queried.

author.php

The author template. Used when an author is queried.

date.php

The date/time template. Used when a date or time is queried. Year, month, day, hour, minute, second.

archive.php

The archive template. Used when a category, author, or date is queried. Note that this template will be overridden by category.php, author.php, and date.php for their respective query types.

search.php

The search results template. Used when a search is performed.

attachment.php

Attachment template. Used when viewing a single attachment.

image.php

Image attachment template. Used when viewing a single image attachment. If not present, attachment.php will be used.

404.php

The 404 Not Found template. Used when WordPress cannot find a post or page that matches the query.

Here are some resources for faster theme development

  1. WordPress frameworks and parent themes
  2. framework for plugin/theme options panel
  3. Best Collection of Code for your functions.php file
  4. Best collection of code for your .htaccess file
share|improve this answer
    
its the index.html I changed to index.php for my wordpress(reverse of what you thought :) ) –  swapnesh Jan 17 '13 at 9:15
    
Ah.. Got it.. :) –  Giri Jan 17 '13 at 9:18
    
what difference does it make via using my method ? bcoz I believe(if I am wrong then let me know) by my way I am not excluding any core file and functionality ? –  swapnesh Jan 17 '13 at 9:20
    
Hi swapnesh, I added my answer because I misunderstood your second point.. Anyway I updated my answer with some extra resources.. By the way don't you think your second point is kind of confusing? replace in the index.php with my index.html. I guess its better be like replace in the index.php with my index.php –  Giri Jan 17 '13 at 9:38
1  
You are welcome mate.. –  Giri Jan 17 '13 at 9:51
show 1 more comment

If the only difference between your new theme and the twentytwelve theme is the index.php and style.css files, then you could use a child theme that is based on the twentytwelve theme.

Then you don't need to copy the twentytwelve directory, instead, you create a new directory with your theme name, put your index.php and style.css files in it, and just make sure that your style.css file's header has Template: Twenty Twelve written in it

share|improve this answer
    
thx for the answer, but its not for a single page..its for the other files as well :) –  swapnesh Jan 17 '13 at 9:36
    
@swapnesh, So you make changes to the other files as well? –  Lea Cohen Jan 17 '13 at 9:56
    
@LeahCohen yes, i believe so as the designer hands me only HTML/css/images and I have to convert it in Wordpress theme –  swapnesh Jan 17 '13 at 9:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.