Skip to content

Instantly share code, notes, and snippets.

@ickarakurt
Last active January 1, 2022 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ickarakurt/c0f0a224fc983b890c4ff3450c4abe40 to your computer and use it in GitHub Desktop.
Save ickarakurt/c0f0a224fc983b890c4ff3450c4abe40 to your computer and use it in GitHub Desktop.
WordPress Theme Development Cheat Sheet

WordPress version :

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

Atom URL :

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

RSS URL :

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

Charset :

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

Blog Name :

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

Blog Description :

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

Blog URL :

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

Stylesheet URL :

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

Template Path :

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

include header.php :

<?php get_header(''); ?>

include sidebar.php :

<?php get_sidebar(''); ?>

include footer.php :

<?php get_footer(''); ?>

List categories :

<?php wp_list_cats('title_li='); ?>

List pages :

<?php wp_list_pages('title_li='); ?>

Display calendar :

<?php get_calendar(''); ?>

List Archives :

<?php wp_get_archives('') ?>

Post title :

<?php the_title(''); ?>

Post permalink :

<?php the_permalink('') ?>

Post category :

<?php the_category(', ') ?>

Post publish date :

<?php the_time('j F Y'); ?>

Post content :

<?php the_content(''); ?>

Post publish time :

<?php the_time('H:i:s'); ?>

Comment count for post :

<?php comments_popup_link(__('0 comment'), __('1 comment'), __('% comments'), '', __('Comments disabled.')); ?>

Post view count (required WP-PostViews plugin) :

<?php if(function_exists('the_views')) { the_views(); } ?>

Post ID :

<?php the_ID(); ?>

Post edit link :

<?php edit_post_link(); ?>

Comment template (Comments.php) :

<?php comments_template(); ?>

Author name :

<?php the_author(''); ?>

About author :

<?php the_author_description(''); ?>

Author first name :

<?php the_author_firstname(''); ?>

Author last name :

<?php the_author_lastname(''); ?>

Post count of author :

<?php the_author_posts('');?>

Author page :

<?php the_author_link('');?>

Author’s web site :

<?php the_author_url(''); ?>

Author’e email address :

<?php the_author_email('');?>

Next post link :

<?php next_post_link('') ?>

Previous post link :

<?php previous_post_link('') ?>

Pagination (pagenavi plugin required) ;

<?php wp_pagenavi(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment