Advertisement
firoze

WordPress Theme Cheat Sheet for Beginners

Jun 18th, 2015
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1.  
  2.  
  3. // code in header.php
  4.  
  5. <?php bloginfo('name'); ?> – Title of the Blog, or Blog Name
  6.  
  7. <?php wp_title(); ?> – Title of a Specific Page
  8.  
  9. <?php bloginfo('url'); ?> – Exact URL for the Site
  10.  
  11. <?php bloginfo('description'); ?> – Site’s Description
  12.  
  13. <?php bloginfo('template_url'); ?> – Location of Site’s Theme File
  14.  
  15. <?php bloginfo('stylesheet_url'); ?> – Link to the Style.css location
  16.  
  17. <?php bloginfo('rss2_url'); ?> – RSS Feed URL for the Site
  18.  
  19. <?php bloginfo('pingback_url'); ?> – Pingback URL for the site
  20.  
  21. <?php bloginfo('version'); ?> – WordPress Version Number
  22.  
  23.  
  24.  
  25.  
  26.  
  27. // other template files
  28.  
  29. <?php get_header(); ?> – Displays Header.php file content
  30.  
  31. <?php get_footer(); ?> – Displays Footer.php file content
  32.  
  33. <?php get_sidebar(); ?> – Displays Sidebar.php file content
  34.  
  35. <?php comments_template(); ?> – Displays Comment.php file content
  36.  
  37. <?php the_content(); ?> – Displays the Content of the Post
  38.  
  39. <?php the_excerpt(); ?> – Displays the excerpt that is used in Posts
  40.  
  41. <?php the_title(); ?> – Title of the Specific Post
  42.  
  43. <?php the_permalink() ?> – Link of the Specific Post
  44.  
  45. <?php the_category(', ') ?> – Category of a Specific Post
  46.  
  47. <?php the_author(); ?> – Author of the Specific Post
  48.  
  49. <?php the_ID(); ?> – ID of a Specific Post
  50.  
  51.  
  52. <?php edit_post_link(); ?> – Edit link for a Post
  53.  
  54. <?php next_post_link(' %link ') ?> – URL of the Next Page
  55.  
  56. <?php previous_post_link('%link') ?> – URL of the Previous Page
  57.  
  58. <?php get_links_list(); ?> – Lists all links in Blogroll
  59.  
  60. <?php wp_list_pages(); ?> – Lists all Pages
  61.  
  62. <?php wp_get_archives() ?> – List Archive for the Site
  63.  
  64. <?php wp_list_cats(); ?> – Lists all Categories
  65.  
  66. <?php get_calendar(); ?> – Displays the Built in Calendar
  67.  
  68. <?php wp_register(); ?> – Displays Register Link
  69.  
  70. <?php wp_loginout(); ?> – Displays Login/Logout Link only to Registered Users
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement