WordPress Theme Development Cheat Sheet


If you don't know how to use this tool please follow the user guide which I mention in the tool description.

Turbo WordPress Cheat Sheet

Complete WordPress theme development cheat sheet for professional and ThemeForest theme development. This cheat sheet helps to develop theme quickly. To know more about WordPress Cheat Sheet read the full article.

WordPress is the world's most popular web development platform. The popularity of WordPress is increasing day by day. The WordPress Theme development is very interesting and demandable work for me and you. You can make and save money via WordPress theme development. There are many web site for selling WordPress themes such as ThemeForest, Template monster etc. This site will pay you for every theme sale. To sell a WordPress template on this web site you must create high quality and professional theme. So you need to learn more and more WordPress theme development tips and tricks. Here I have tried to collect some WordPress cheat sheets for new and experienced theme developers. Personally, This WordPress theme development cheat sheet is very helpful for me. It helps me create new WordPress theme quickly for my client. I know experienced web developers know all codes but you will get it at a time. So let go to learn WordPress theme development by using this WordPress theme development cheat sheet.

WordPress Theme Structure

At first, you must know about the WordPress theme structure. To create a WordPress theme you should create some necessary PHP file such as.

header.php ...................... Header Section
index.php ......................... Main Section
sidebar.php .................... Sidebar Section
single.php ....................... Single Post Template
page.php ......................... Page Template
comments.php .................. Comment Template
search.php ...................... Search Content
searchform.php ............ Search Form Template
archive.php ................... Archive Template
functions.php ................ Special Functions
404.php .................... Error Page template
style.css .......................... Style Sheet

WordPress Loop

<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>

// The Stuff... Custom HTML & PHP Code

<?php endwhile; ?>
<?php endif;?>

WordPress category based loop

<?php query_posts('category_name=Category&showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>

// The Stuff... Custom HTML & PHP Code

<?php endwhile;?>

Here, category_name=Category mean category_name=your category slug name showposts=5 mean it will display 5 posts. To display more post type your number.

WordPress Template includes tags

The below template tags will call another part of the WordPress template

<?php get_header();?>

These template tags will call your template’s header.php file.

<?php get_sidebar();?>

These template tags will call your template’s sidebar.php file.

<?php get_template_part('footer', 'above'); ?>

These template tags will call your template’s sidebar-above.php file. (If you use many sidebars for your theme.)

<?php get_footer();?>

These template tags will call your template’s footer.php file.

<?php comments_template();?>

These template tags will call your template’s comments.php file.

WordPress Template Tags

By using the below WordPress template tags you will be able to design your site perfectly. Really the below codes are very important for WordPress Theme development

Displays the posts/pages title

<?php the_title() ?>

Displays the content of the post/page

<?php the_content() ?>

Displays the excerpt of the current post/page

<?php the_excerpt() ?>

Displays the time of the current post/page

<?php the_time() ?>

Displays the date of a post or set of post/page

<?php the_date() ?>

Displays the URL for the permalink

<?php the_permalink() ?>

Displays the category of a post

<?php the_category() ?>

Displays the author of the post

<?php the_author(); ?>

Displays the numeric ID of the current post

<?php the_ID(); ?>

Displays all the pages

<?php wp_list_pages(); ?>

Displays a tag cloud

<?php wp_tag_cloud(); ?>

Displays the categories

<?php wp_list_cats(); ?>

Displays the calendar

<?php get_calendar(); ?>

Displays a date-based archives list

<?php wp_get_archives() ?>

Displays Previous page and Next Page links

<?php posts_nav_link(); ?>

Displays Newer Posts link

<?php next_post_link() ?>

Displays previous link

<?php previous_post_link() ?>

Displays the edit link

<?php edit_post_link(__('Edit Post')); ?>

Value for the search form

<?php the_search_query();?>

Displays the register link

<?php wp_register();?>

Displays the login/out link

<?php wp_loginout();?>

Meta for administrators

<?php wp_meta();?>

Time to load the page

<?php timer_stop(1);?>

Displays the custom field1

<?php echo c2c_custom('test');?>

Display links from Blogroll

<?php get_links_list(); ?>

Displays the built-in calendar

<?php get_calendar(); ?>

Link of the post's comments

<?php comments_popup_link(); ?>

WordPress BlogInfo Tags

Title of the blog

<?php bloginfo('name'); ?>

The character set

<?php bloginfo('charset'); ?>

The description of the blog

<?php bloginfo('description'); ?>

The address of the blog

<?php bloginfo('url'); ?>

The RSS URL

<?php bloginfo('rss2_url'); ?>

URL of the template

<?php bloginfo('template_url'); ?>

The pingback URL

<?php bloginfo('pingback_url'); ?>

The URL for the template's CSS file

<?php bloginfo('stylesheet_url'); ?>

URL for WordPress installation

<?php bloginfo('wpurl'); ?>

The version of the WordPress installation

<?php bloginfo('version'); ?>

HTML version of the site

<?php bloginfo('html_type'); ?>

WordPress Navigation Menu

Category Based Navigation

<ul id="menu">
  <li><a href="<?php bloginfo('home'); ?>">Home</a></li>
  <?php wp_list_categories('title_li=&orderby=id'); ?>
</ul>

Pages based Navigation

<ul id="menu">
  <a href="<?php bloginfo('home'); ?>">Home</a>
  </li>
  <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
</ul>

Conclusion:

At the end of the WordPress theme development cheat sheet. I will tell again this WordPress cheat sheet is very important. I have written a short description of every code. I will try to tell the details of the above codes by creating some post next time. Please share this post with your friends and others via a social and bookmarking site. It may be helpful for them. Thank you.