WordPress Functions

For this tutorial I am going to cover some of the most common WordPress functions that developers use on a regular basis.

Header Tags

Display the blog name

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

Display the blog url

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

The stylesheet location

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

The location of the theme files directory

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

The atom url for the blog

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

Display the Rss2 url for the blog

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

The charset of the blog

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

Pingback url of the blog

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

WordPress version of the blog

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

HTML version of the website

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

Template Tags

Display the page title

<?php the_title(); ?>

Display the content

<?php the_content(); ?>

Display the exerpt

<?php the_exerpt(); ?>

Display the published date

<?php the_date(); ?>

Display the published time

<!--?php the_time(); ?-->

Display the category

[/code]

Display the url link for the page/post

[/code]

Display the number ID of the post

<?php the_ID(); ?>

Display the author of the post

<?php the_author(); ?>

Display the previous page and next page links

<?php posts_nav_link(); ?>

Display the newer posts link

<?php next_post_link(); ?>

Display the previous posts link

[/code]

Display a link to edit the post

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

Display the search form value

<?php the_search_query(); ?>

Display the pages

<?php wp_list_pages(); ?>

Display the tag cloud

<?php wp_tag_cloud(); ?>

Display the categories

<?php wp_list_cats(); ?>

Display the calendar

<?php get_calendar(); ?>

Display the archives by date

<?php wp_get_archives(); ?>

Display the blogroll link

<?php get_links_list(); ?>

Display a register link

<?php wp_register(); ?>

Display a login/logout link

<?php wp_loginout(); ?>

Displays the admin meta

<?php wp_meta(); ?>

Summary

These are the most common Template tags used in WordPress Development. It is not intended to be a complete list of WordPress functions, just the common ones for someone just getting started developing with WordPress.

Many of the template tags are meant to be used within the WordPress loop but I have also included some like login/logout, calendar and some other ones that are commonly placed in the sidebar or footer.

Tweet It. Share It.

See more Wordpress