WordPress Cheat Sheet for developers

Last Updated on

If you wish to download the WordPress cheat sheet directly into your computer, download this pdf. file.

This WordPress Cheat Sheet should be enough to get you started developing or tweaking WordPress themes.

You might also like:

Basic template files
style.css
Style sheet file
index.php
Include any file
single.php
Single post page file
archive.php
Archive or Category file
archive.php
Archive or category file
searchform.php
Search form file
search.php
Search content file
404.php
comments.php
footer.php
Footer content file
header.php
Header content file
sidebar.php
Sidebar content file
page.php
Single page file
PHP snippets for header
bloginfo('name');
Title of the site
wp_title();
Title of the specific post or page
get_stylesheet_directory_uri();
The style.css file’s location
bloginfo('pingback_url');
Pingback URL for this site
bloginfo('template_url');
Location for the site’s theme files
bloginfo('version');
WordPress version for the site
bloginfo('atom_url');
Atom URL for the site
bloginfo('rss2_url');
RSS2 URL for the site
get_site_url();
Exact URL for the site
bloginfo('name');
Name of the site
bloginfo('html_type');
HTML version of the site
bloginfo('charset');
Charset parameter of the site
PHP snippets for templates
the_content();
Content of the posts
if(have_posts()):
Check if there are posts
while(have_posts()): the_post();
Shows posts if posts are available
endwhile;
Closes the ‘while’ PHP function
endif;
Closes the ‘if’ PHP function
get_header();
Header.php file’s content
get_sidebar();
Sidebar.php file’s content
get_footer();
Footer.php file’s content
the_time('m-d-y');
The date in ’month-day-year′ format
comments_popup_link();
Link for the comments on the post
the_title()';
Title of a specific post or page
the_permalink();
URL of a specific post or page
the_category();
Category of a specific post or page
the_author();
Author of a specific post or page
the_ID();
ID of a specific post or page
edit_post_link();
Link to edit a specific post or page
get_links_list();
Links from the blogroll
comments_template();
Comment PHP file’s content
wp_list_pages();
List of pages of the site
wp_list_cats();
List of categories for the site
next_post_link('%link');
URL to the next post
previoust_post_link('%link');
URL to the previous post
get_calendar()'
The built-in calendar
wp_get_archives();
List of archives for the site
posts_nav_link();
Next and previous post links
bloginfo('description');
Site’s description

Navigation menu

Categories based navigation
<ul id="menu">
<li <?php if(is_home()) { ?> class="current-cat" <?php } ?> >
<a href="<php bloginfo('home'); ?>">Home</a></li>
<?php wp_list_categories('title_li=&orderby;=id'); ?>
</ul>
Pages based navigation
<ul id="menu">
<li <?php if(is_home()) { ?> class="current_page_item" <?php } > >
<a href="<php bloginfo('home'); ?>">Home</a></li>
<?php wp_list_pages('sort_column=menu_order&depth;=1&title;_li='); ?>
</ul>
Extra stuff
/%postname%/
Custom permalinks
include(TEMPLATEPATH . '/x');
Include any file
the_search_query();
Value for search form
_e('Message');
Prints out message
wp_register();
Displays the register link
wp_loginout();
Displays the login/logout link
<!--next page-->
Divides the content into pages
Cuts off the content and adds a read more link
wp_meta();
Meta for administrators
timer_stop(1);
Time to load the page
echo get_num_queries();
Queries to load the page
The loop
<php if(have_posts()): ?>
<php while(have_posts()): the_post(); ?>
// Post content here (Custom HTML & PHP code)
<php else; ?>
<php endif; ?>
Update: Some people requested a .jpg version of this table, here you go:
WordPress cheat sheet

This chart is mainly for web designers and developers who use WordPress. But you can use this sheet to improve your skills and learn some of the basics. It’s pretty handy and comes useful when you are trying to tweak/edit your WordPress blog.

As an Average Joe, you don’t need to know about all those things.

Advanced WordPress cheat sheet

Click on the picture to enlarge or Download PDF version Advanced Cheat Sheet

342Shares
Share or comment

12 thoughts on “WordPress Cheat Sheet for developers”

    1. Hi irfanali,

      Thanks for the kind words! We work hard to see happy readers/followers like you. I hope it makes your life a bit easier.

      Cheers,
      Karen

  1. This is awesome! Im just starting to learn to create WP themes and saw this link on the Template Monster site. Thank you!

    1. I’m glad you find it useful!

      Let me know when your first WP theme is ready. I’ll try it out for sure!

      Cheers

  2. Nice cheat sheet, good work. One thing that bothers me is that traditionally a while loop is used to loop through many items, and here they use it to loop through just 1 item. In while has posts, the post?

    Can you explain that to me please?

  3. Excellent cheatsheet. I would like to add one though, the action hook . This hook makes it possible for you to add elements to the such as stylesheets, meta tags and scripts.

  4. Very helpfull,
    could you please make the JPG-Cheatsheet “readable” for Printers? I just printed it and can’t read anything on the printed page.

    Thanks

  5. Thanks for sharing this useful WordPress cheat-sheet, very helpful and informative who are new to WordPress and need to learn more above these stuffs!

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

342Shares

FREE Email Blogging Course

Subscribe to our newsletter and learn how to build a successful blog

Learn how to...

  • Write the perfect blog post
  • Drive tons of free traffic
  • Design your blog like a pro
  • Get answers to all your blog questions