Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ******Wordpress theme development startup code/rule*******
- *****You can use those in all wordpress theme*****
- Step 1: First Insert your html/css template in wordpress theme folder.
- Step 2: Now, Rename 'index.html' into 'index.php'.
- Step 3: Make a screenshot.png images (width: 880px, height: 660px) and put it in your theme folder root directory.
- Step 4: Open 'style.css' file, Type this code top of the css
- /*
- Theme Name:
- Theme URI:
- Author:
- Author URI:
- Version:
- Description:
- Tags:
- License: GNU General Public License v1 or later
- License URI:
- Text Domain:
- */
- Step 4: Now, Type this code top end part of </head> tag and </body> tag:
- <?php wp_head(); ?>
- <?php wp_footer(); ?>
- Step 5: Now, Make your theme dynamic
- <?php bloginfo('name'); ?> //Dynamic code for 'site title'
- <?php bloginfo('description'); ?> //Dynamic code for 'site description'
- <?php bloginfo('stylesheet_url');?> //Dynamic code for 'style.css'
- <?php bloginfo('home');?> //Dynamic code for 'Logo' Home link
- <?php echo get_template_directory_uri(); ?> //Dynamic code for 'Other Stylesheet,JS,Images'
- Step 6:Than Divide all html code of the template into another part and call them in index.php with this code
- <?php get_header(); ?> // To call 'header'
- <?php get_sidebar(); ?> // To call 'Sidebar'
- <?php get_footer(); ?> // To call 'footer'
- <?php echo get_template_part('slider'); ?>' //To call 'Any part of template'(e.g. for slider)
- ****Some important code for wordpress theme development.This code use in index.php file
- <?php echo $post->post_name; ?> //for post or page slug
- <?php the_ID(); ?> //for post or page id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement