Template File List – WordPress

WordPress-Cheat-Sheet-Sheet1.pdf
Basic Template Files
style.cssStyle sheet file
index.phpHome Page file
single.phpSingle post page file
archive.phpArchive or Category file
searchform.phpSearch form file
search.phpSearch content file
404.phpError page file
comments.phpComments template file
footer.phpFooter content file
header.phpHeader content file
sidebar.phpSidebar content file
page.phpSingle 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
Navigation menu
Category Based Navigation
<ul id="menu">
<li <?php if(is_home()) { ?> class="current-cat" <?php } ?> >
<a href="<php%20bloginfo('home');%20?>">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%20bloginfo('home');%20?>">Home</a></li>
<?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
</ul>
Extra stuff
/%postname%/
Custom permalinks
include(TEMPATEPATH . '/x');
Include any file
the_search_query();
Value for search form
_e('Message');
Prints out message
wp_register();
Displays the register link
wp_loginout();
Displas the login/logout link
<!--next page-->
Divides the content into pages
<!--more-->
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
Scroll to Top