How to create wordpress theme

576

Creating theme very simple in wordpress. Please follow below steps for creating them.

  1. we have to create sub-folder under wp-content/themes
  2. create theme folder like ‘alertinfo’ under wp-content/themes. Now our folder structure wp-content/themes/alertinfo/
  3. then we have to create files like below under  ‘alertinfo’ folder

In below files style.css is mandatory  for enable the theme from admin side. In style.css we have to write the theme name,description,version and author in between comments like below.

/*

Theme Name: alertinfo
Theme URI: http://www.alertinfo.in/
Author: alertinfo
Description: Our 2015 default theme is clean.
Version: 1.2
Author URI: http://www.alertinfo.in/

*/

we have to good knowledge in theme files  before creating any theme from scratch.

index.php : it’s a main template

header.php : we have to write custom header part in this file. make sure we have to add the wp_head() between header html tag.

footer.php:    write custom footer part in this file. make sure we have to add the wp_footer() in footer.php

style.css : its a mandatory file. we hate to write theme info

function.php :- using this we can extend the wordpress existing functionality.

page.php :- using this we can display the page file info.

single.php : using this we can display the posts detail information.