Convert html to wordpress

-> First , create a folder in themes folder of wp-content

->Make following files  : 1) style.css 2) header.php  3) footer.php 4) functions.php  5) sidebar.php 6)  index.php  7) page.php

style.css

These comments simply help WordPress properly identify the theme.

header.php

line 6 : <?php bloginfo(‘title’); ?>// Show blog title
line 8 : <?php bloginfo(‘stylesheet_url’); ?>//Displays the primary CSS (usually style.css) file URL of the active theme
line 9 :  <?php wp_head(); ?>//The wp_head action hook is triggered within the <head></head> section of the user’s template by the wp_head() functionThis hook is theme-dependent which means that it is up to the author of each WordPress theme to include it.
line 16 : <?php bloginfo(‘name’); ?>//Displays the “Site Title” set in Settings > General
line 17 : <?php bloginfo(‘description’); ?>//Displays the “Tagline” set in Settings > General.
line 23 : <?php wp_nav_menu(); ?>//Displays a navigation menu created in the Appearance → Menus panel.  

 footer.php

 functions.php

The functions file behaves like a WordPress Plugin, adding features and functionality to a WordPress site. You can use it to call functions, both PHP and built-in WordPress, and to define your own functions. 

line 4 : <?php add_theme_support(‘post-thumbnails’); ?>
Post Thumbnail,  is an image that is chosen as the representative image for Posts, Pages or Custom Post Types.
line 7 :  <?php add_theme_support(‘menus’); ?>
Add menus field in Appearance of wordpress dashboard
 line 10 : register_sidebar
(string/array) Builds Sidebar based on ‘name’ and ‘id’ values... Call on “widgets_init” action.

sidebar.php

The sidebar is a narrow vertical column with lots of information about a website.

line 2: dynamic_sidebar
This function calls each of the active widget callbacks in order, which prints the markup for the sidebar

index.php

index.php calls the home page.

line 2 : get_header()
include header file
line 3 : while(have_posts())
it loop over all posts 
line 6 : the_title()
Displays or returns the title of the current post. 
line 9 : the_author_posts_link()
Displays a link to all posts by an author. The link text is the user’s Display name publicly asfield.
 line 10 : the_time(‘F  jS , Y’)
Displays the time of the current post.
line 12 : comments_link()
The comments_link template tag displays the URL to the current post’s comments. This tag must be within The Loop, or the loop set up for comments.

page.php

Pages are for content such as “About,” “Contact,” etc. and are often used to present timeless information about your site. 

1,121 total views, 1 views today

Share this OnShare on FacebookTweet about this on TwitterShare on LinkedInShare on Google+

Leave a Reply