1/21/2016 - 4:20 AM

WordPress Cheatsheet

WordPress Cheatsheet

##Theme Structure

header.phpHeader Section
index.phpMain Section
sidebar.phpSidebar Section
single.phpPost Template
page.phpPage Template
comments.phpComment Template
search.phpSearch Content
searchform.phpSearch Form Template
archive.phpArchive Template
functions.phpSpecial Functions
404.phpError Page template
style.cssStyle Sheet

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

##The Category Based Loop // The Stuff... Custom HTML & PHP Code

##Theme Definition /* Theme Name: Wordpress Theme URI: Description: Test Blog Version: 1.6 Author: Ekin Ertaç Author URI: Tags: powerful, cheat, sheet */

##Template Include Tags < ?php get_header(); ?> < ?php get_sidebar(); ?> < ?php get_footer(); ?> < ?php comments_template(); ?>

##WordPress Template Tags

Displays the posts/pages title
Displays the content of the post/page
Displays the excerpt of the current post/page
Displays the time of the current post/page
Displays the date of a post or set of post/page
Displays the URL for the permalink
Displays the category of a post
Displays the author of the post
Displays the numeric ID of the current post
Displays all the pages
Displays a tag cloud
Displays the categories
Displays the calendar
Displays a date-based archives list
Displays Previous page and Next Page links
Displays Newer Posts link
Displays previous link
Displays the edit link
Value for search form
Displays the register link
Displays the log in/out link
Meta for administrators
Time to load the page
Displays the custom field
Display links from Blogroll
Displays the built-in calendar
Link of the posts comments

##BlogInfo Tags

Template TagDescription
Title of the blog
The character set
The description of the blog
The address of the blog
The URL of the template
The pingback URL
The URL for the template's CSS file
URL for WordPress installation
Version of the WordPress installation
HTML version of the site

##Conditional Tags

Template TagDescription
is_home()When the user is on the blog home page
is_front_page()When the user is on the home page
is_single()When the single post displayed
is_sticky()Check if a post is sticky
is_page()When a page is displayed
is_category()When a category is displayed

##Navigation Menu

###Category Based Navigation

    <li class="current-cat"< ?php } ?>> Home

###Pages based Navigation

    <li class="current_page_item"< ?php } ?>> home < ?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>