Friday, April 3, 2015

How to create a WordPress theme?

How to create a WordPress theme?

Before building a WordPress theme you just crate a folder in WordPress directory wp-content/themes in your website.example you named my_gallery the name of this folder should the same to the name of the theme you want to create.
Next, you should decide which the layout of your website will be crate. In general a WordPress theme layout is consist of files sidebar, a header, content area and a footer and all of this file are connect to a file is index.php 
general files:
  • header.php
  • index.php 
  • sidebar.php
  • footer.php
  • style.css 
 all of this file connected to index file by using php function:
<?php 
get_header();  //  connect to header.php
get_sidebar(); // connect to sidebar.php
get_footer(); // connect to footer.php
?>
Connection of sytle.css in consisit in file header.php
<html>
<head>
 <title>Tutorial theme</title>
 <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
</head>
<body>
<div id="wrapper">
<div id="header">
 <h1>HEADER</h1>
</div>
*style.css is a file not only modify css but it also list information of theme:

/*  
Theme Name:    RealEstate
Theme URI:     http://templatic.com/
Description:   Developed by Templatic team.
Version:       2.3.18
Author:        Templatic.com
Author URI:    http://templatic.com/

*/

/*             IMPORTANT NOTE!
               If you wish to make custom changes to your theme, DO NOT EDIT THIS FILE. Instead, use the custom.css template
               to define custom styles. This way, you will still be able to take advantage of future upgrades to the theme
               without worrying about overwriting your style changes.
*/
 
 
 
 
 
 
 
 
******** Add Gadget on Template Designer Layout of Google blogger

No comments:

Post a Comment