Advertisement
afsarwebdev

WP Basic Instruction

Oct 1st, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. Basic Instruction:
  2.  
  3. 1. convert index.html file to index.php
  4.  
  5. 2. create a screenshot.png
  6.  
  7. 3. write the following code on style.css
  8. /*
  9. Theme Name: Subway - Complete Theme for Working Website
  10. Theme URI: http://technotiers.com/subway
  11. Description: Complete Theme for Working Website
  12. Version: 1.0
  13. Author: Walid Newaz
  14. Author URI: http://technotiers.com/mounter
  15. Tags: light, white, landing page, minimal design, flat design, single page, multipurpose, custom colors, bootstrap, responsive, html5, css3, jQuery plugin, Redux Framework, CMB2, one page wordpress
  16. */
  17.  
  18. 4. to dynamic necessary files (css/js/images) write the following code
  19.  
  20. <?php echo get_template_directory_uri(); ?>/
  21.  
  22. 5. to dynamic style.css
  23.  
  24. <?php bloginfo('stylesheet_url'); ?>
  25.  
  26. 6. write the following code before </head>
  27.  
  28. <?php wp_head(); ?>
  29.  
  30. 7. write the following code before </body>
  31.  
  32. <?php wp_footer(); ?>
  33.  
  34. 8. some important tag to be dynamic in WordPress
  35. a. for <html>
  36.  
  37. <html <?php language_attributes(); ?>>
  38.  
  39. b. for <meta charset="utf-8">
  40.  
  41. <meta charset="<?php bloginfo("charset"); ?>">
  42.  
  43. c. for <title>This is Title</title>
  44.  
  45. <title><?php wp_title('|', true, 'right'); ?> <?php if (get_query_var('paged')) { echo get_query_var('paged') . ' page'; } ?> <?php bloginfo('name'); ?></title>
  46.  
  47. d. for <body>
  48. <body <?php body_class(); ?>>
  49.  
  50. 9. file separation---
  51.  
  52. for header: <?php get_header(); ?>
  53.  
  54. for footer: <?php get_footer(); ?>
  55.  
  56. for others file: <?php get_template_part('file name'); ?>
  57.  
  58. 10. create a file functions.php (the most powerful file in WordPress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement