Display Blogroll Links
<ul>
<?php get_links_list(); ?>
</ul>
Display Admin Section
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="http://www.wordpress.org/">WordPress</a></li>
<?php wp_meta(); ?>
<li><a href="http://validator.w3.org/check?uri=referer">XHTML</a></li>
</ul>
Display a Pages SubMenu in your Sidebar
This will display any subpages in your blog’s sidebar:
<?php$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');if ($children) { ?><ul> <?php echo $children; ?>
</ul>
<?php } ?>
Display WordPress Tags
<?php the_tags(); ?>
Display WordPress Tags Cloud
<?php wp_tag_cloud('smallest=8&largest=36&'); ?>
Template Name
This allows you to use the WordPress page template to customize how a page is displayed:
<?php /* Template Name: Portfolio */ ?>
Dynamic Title Tags
<title><?phpif (is_home()) { echo bloginfo('name');
} elseif (is_404()) {
echo '404 Not Found';
} elseif (is_category()) {
echo 'Category:'; wp_title('');
} elseif (is_search()) {
echo 'Search Results';
} elseif ( is_day() || is_month() || is_year() ) {
echo 'Archives:'; wp_title('');
} else {
echo wp_title('');
}
?></title>
Display PHP on a Single Page
Allows you to display plugins and such on a single page (replace home with the page you want it to only appear on):
<?php if ( is_home() ) { include ('file.php'); } ?>
Display an External RSS Feed
<?php include_once(ABSPATH.WPINC.'/rss.php');
wp_rss('http://wpforums.com/external.php?type=RSS2', 5); ?>
Display Most Recent Twitter Entry
<?php
// Your twitter username.
$username = "TwitterUsername";
// Prefix - some text you want displayed before your latest tweet.
// (HTML is OK, but be sure to escape quotes with backslashes: for example href=\"link.html\")
$prefix = "";
// Suffix - some text you want display after your latest tweet. (Same rules as the prefix.)
$suffix = "";
$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1";
function parse_feed($feed) {
$stepOne = explode("<content type=\"html\">", $feed);
$stepTwo = explode("</content>", $stepOne[1]);
$tweet = $stepTwo[0];
$tweet = str_replace(”<”, “<”, $tweet);
$tweet = str_replace(”>”, “>”, $tweet);
return $tweet;
}
$twitterFeed = file_get_contents($feed);
echo stripslashes($prefix) . parse_feed($twitterFeed) . stripslashes($suffix);
?>
I’m expecting this list to grow over time as I come across more useful WordPress code and update the post.