THE QUICKLIST
The very basics of WP functions that can be used with your theme. I hope you find them useful.
Codes in your Header.php
These codes will be found in your header.php file but can be utilized throughout your template depending on your needs.
HEADER INFORMATION:
<?php bloginfo('name'); ?> – Displays blog name. Set in WP-admin.
<?php bloginfo('description'); ?> – Can you guess? Pulls descr. from WP-admin.
<?php wp_title(); ?>– Title of page.
<?php bloginfo('url'); ?> – This is the location for your sites theme.
<?php bloginfo('template_url'); ?>
<?php bloginfo('stylesheet_url'); ?> – Gotta link to that style sheet.
<?php bloginfo('rss2_url'); ?> – RSS feed url.
<?php bloginfo('pingback_url'); ?> – Pingback url.
Putting the page together
INCLUDES:
<?php get_header(); ?>– Calls the Header.php file.
caution: This tag includes the file header.php from your current theme’s directory. If that file is
not found, it will instead include wp-content/themes/default/header.php
<?php get_footer(); ?>– Calls Footer.php file.
caution: This tag includes the file footer.php from your current theme’s directory. If that file is
not found, it will instead include wp-content/themes/default/footer.php
<?php get_sidebar(); ?>– Calls Sidebar.php file.
This tag includes the file sidebar.php from your current theme’s directory. If that file is
not found, it will instead include wp-content/themes/default/sidebar.php
include for any template
using the TEMPLATEPATH constant for including files.
<?php include (TEMPLATEPATH . '/header.php'); ?>
<?php include (TEMPLATEPATH . '/sidebar.php'); ?>
<?php include (TEMPLATEPATH . '/footer.php'); ?>
So if your page is looking way off, make sure your files are in place and then check for syntax or misplaced div tags.
Basic Codes (“Functions”) within your template files
home.php, index.php, single.php, etc. – Ease of use makes them brilliant for making your blog dynamic.
POST:
<?php the_title(); ?> – Title of the post.
<?php the_permalink() ?> – Link to post. Make sure to use for “pretty urls.”
<?php the_category(', ') ?> – Category or categories of a post.
<?php comments_template(); ?> – Displays comment content.
<?php the_content(); ?> – Displays the post. Used with “the loop.”
<?php the_excerpt(); ?> – Displays abridged content of post if used.
POST META:
<?php the_author(); ?> – Calls author of the post.
<?php the_ID(); ?>
<?php edit_post_link(); ?>– Displays the edit link.
BOTTOM NAVIGATION:
<?php next_post_link(' ') ?> – Next Page if more posts exist.
<?php previous_post_link(' ') ?> – Previous Page. Like a back button.
Basic Codes (“Functions”) to lists pages, categories, etc.
LINKAGE:
<?php get_links_list(); ?> – Lists all links in Blogroll
<?php wp_list_pages(); ?> – Lists all Pages
<?php wp_get_archives() ?> – List Archive for the Site
<?php wp_list_cats(); ?> – Lists all Categories
SITE META:
<?php wp_register(); ?> -register new users.
<?php wp_loginout(); ?> -login or logout depending on user status.
This list is NOT all inclusive and the descriptions are pretty basic but I hope it cleared up a couple of your questions. For in-depth coverage of creating your own customized theme, the Codex can take you to the next step.
Tags: Functions, Template, Theme, WordPress


Want Something Else?