HTML to WordPress
Convert HTML to WordPress theme part-1
This is first chain tune. In this tune I going to steps by step guide “How to convert a HTML template into wordpress theme”. From this tune everyone can easily convert HTML to wordpress theme
1. Index.html rename index.php
2. Must need a style.css same location in index.php and also can add screenshot.png image for your theme.
Style.css must contain some comment info like below:
/* Theme Name: prowpexpart Theme URI: http://sohel.prowpexpert.com/ Author: md sohel Author URI: http://prowpexpert.com/ Description: This is a nice looking respinsive wordpress theme for your blog. Version: 1.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: prowpexpart Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, fluid-layout ,fixed-layout This theme, like WordPress, is licensed under the GPL. */
3. Add <?php echo get_template_directory_uri(); ?>/ this line all href and scr prefix which call/use from local folder.
Example:
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/responsive.css" /> <script src="<?php echo get_template_directory_uri(); ?>/js/vendor/modernizr-2.6.2.min.js"></script> <a href=""><img src="<?php echo get_template_directory_uri(); ?>/images/logo.jpg"></a>
4. Must main style.css will be like: <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” />
Example:
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" />
5. Title can be dynamic by using <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title>
Example:
<meta charset="<?php bloginfo( 'charset' ); ?>"> <title><?php wp_title( '|', true, 'right' ); ?></title> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
6. Add <?php wp_haed(); ?> before end of </html> and add <?php wp_footer(); ?> before end of </body>
Like:
<?php wp_head(); ?> </head> //And <?php wp_footer(); ?> </body>
7. Separate header section in header.php , Separate footer section in footer.php , Separate sidebar section in sidebar.php and Separate other section in other.php and serially call <?php get_header();?> <?php get_footer();?> <?php get_sidebar();?> & <?php get_template_part(‘other’);?> .
8. Every jquey activation $ sign convert into jQuery
Example:
jQuery(document).ready(function(){ jQuery('#nav').slicknav(); });
Comments are closed