Advertisement
shakil97bd

Wordpress theme development startup code/rule

Aug 6th, 2014
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.68 KB | None | 0 0
  1. ******Wordpress theme development startup code/rule*******
  2.  
  3. *****You can use those in all wordpress theme*****
  4.  
  5. Step 1: First Insert your html/css template in wordpress theme folder.
  6.  
  7. Step 2: Now, Rename 'index.html' into 'index.php'.
  8.  
  9. Step 3: Make a screenshot.png images (width: 880px, height: 660px) and put it in your theme folder root directory.
  10.  
  11. Step 4: Open 'style.css' file, Type this code top of the css
  12.  
  13. /* 
  14. Theme Name:
  15. Theme URI:
  16. Author:
  17. Author URI:
  18. Version:   
  19. Description:
  20. Tags:
  21. License: GNU General Public License v1 or later
  22. License URI:    
  23. Text Domain:
  24. */
  25.  
  26. Step 4: Now, Type this code top end part of </head> tag and </body> tag:
  27.  
  28.     <?php wp_head(); ?>
  29.     <?php wp_footer(); ?>
  30.  
  31. Step 5: Now, Make your theme dynamic
  32.  
  33.         <?php bloginfo('name'); ?>              //Dynamic code for 'site title'  
  34.         <?php bloginfo('description'); ?>       //Dynamic code for 'site description'  
  35.         <?php bloginfo('stylesheet_url');?>     //Dynamic code for 'style.css'  
  36.         <?php bloginfo('home');?>               //Dynamic code for 'Logo' Home link
  37.         <?php echo get_template_directory_uri(); ?> //Dynamic code for 'Other Stylesheet,JS,Images'
  38.        
  39. Step 6:Than Divide all html code of the template into another part and call them in index.php with this code
  40.  
  41.     <?php get_header(); ?>              // To call 'header'
  42.     <?php get_sidebar(); ?>             // To call 'Sidebar'
  43.     <?php get_footer(); ?>              // To call 'footer'
  44.     <?php echo get_template_part('slider'); ?>' //To call 'Any part of template'(e.g. for slider)
  45.      
  46. ****Some important code for wordpress theme development.This code use in index.php file
  47.  
  48.     <?php echo $post->post_name; ?>                             //for post or page slug
  49.     <?php the_ID(); ?>                                          //for post or page id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement