Skip to content

Instantly share code, notes, and snippets.

@chasereeves
Created March 31, 2011 15:57
Show Gist options
  • Save chasereeves/896638 to your computer and use it in GitHub Desktop.
Save chasereeves/896638 to your computer and use it in GitHub Desktop.
Runx list of wordpress tags, reference, etc.
CONDITIONAL STATEMENTS
======================
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
TEMPLATE TAGS
=============
<?php the_title() ?> ...........................................Displays the posts/pages title
<?php the_title_attribute() ?> .......Displays the post/page title for alt/title tags in links
<?php the_content() ?> ..................................Displays the content of the post/page
<?php the_excerpt() ?> ..........................Displays the excerpt of the current post/page
<?php the_time() ?> ................................Displays the time of the current post/page
<?php the_date() ?> ...........................Displays the date of a post or set of post/page
<?php echo get_the_time(get_option('date_format')); ?> ............Another way to display date
<?php the_author_posts_link(); ?> ..................................the author name with link
<?php the_permalink() ?> ...................................Displays the URL for the permalink
<?php the_category() ?> .......................................Displays the category of a post
<?php wp_list_cats(); ?> .......................Displays a list of categories outside the loop
<?php echo get_the_category_list(', '); ?> ..........Displays a list of categories within loop
<?php the_author(); ?> ........................................Displays the author of the post
<?php the_ID(); ?> ................................Displays the numeric ID of the current post
<?php wp_list_pages(); ?> ..............................................Displays all the pages
<?php the_tags('before', ', ', 'after'); ?> .......................Displays a list of all tags
<?php wp_tag_cloud(); ?> .................................................Displays a tag cloud
<?php wp_list_cats(); ?> ..............................................Displays the categories
<?php wp_get_archives() ?> ................................Displays a date-based archives list
<?php posts_nav_link(); ?> .........................Displays Previous page and Next Page links
<?php next_post_link() ?> ...........................................Displays Newer Posts link
<?php previous_post_link() ?> ..........................................Displays previous link
<?php edit_post_link(__('Edit Post')); ?> ..............................Displays the edit link
<?php comments_popup_link(); ?> ....................................Link of the posts comments
BLOGINFO TAGS
=============
<?php bloginfo('name'); ?> .................................................Title of the blog
<?php bloginfo('charset'); ?> ..............................................The character set
<?php bloginfo('description'); ?> ................................The description of the blog
<?php bloginfo('url'); ?> ............................................The address of the blog
<?php bloginfo('rss2_url'); ?> ...................................................The RSS URL
<?php bloginfo('template_url'); ?> ...................................The URL of the template
<?php bloginfo('pingback_url'); ?> ..........................................The pingback URL
<?php bloginfo('stylesheet_url'); ?> ......................The URL for the template's CSS file
<?php bloginfo('wpurl'); ?> ...................................URL for WordPress installation
<?php bloginfo('version'); ?> ..........................Version of the WordPress installation
<?php bloginfo('html_type'); ?> .....................................HTML version of the site
THESIS SPECIFIC TAGS
====================
<?php thesis_nav_menu(); ?> ...................................................Thesis Nav Menu
<?php thesis_search_form(); ?> ...........................................Thesis Search widget
remove_action('thesis_hook_after_post', 'thesis_comments_link'); ....Remove blog comment count
MENUS
=====
// ------------------------------------------------------------------ Register Wordpress Menus
function register_my_menus() { register_nav_menus( array('footer_menu' => __( 'Footer Menu' ) ) ); }
add_action( 'init', 'register_my_menus' );
// -------------------------------------------------------------------- Then to place the menu
<?php wp_nav_menu( array( 'theme_location' => 'footer_menu', 'container_id' => 'footer_bottom' ) ); ?>
SIDEBARS
========
.............................................................................Register Sidebars
register_sidebar(array(
'name' => 'Main Sidebar',
'id' => 'sidebar_1',
'description' => 'Shows up on all pages by default.',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
...........................................................................Unregister Sidebars
unregister_sidebar( 'sidebar-1' );
Reference Source ==> http://docs.ekinertac.com/Wordpress-Cheat-Sheet.pdf
@norcross
Copy link

Add the following:

...........................................Displays the posts/pages title, used for alt / title tags in links (as to not break links with certain characters)

@chasereeves
Copy link
Author

Ah merci, had no idea you commented here. Wonder if I can get notifications of this shiz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment