Book Image

WordPress 2.7 Cookbook

Book Image

WordPress 2.7 Cookbook

Overview of this book

About 120,000 blogs are created every day. Most of them quickly die, but a few stay, grow up, and then become well known and respected places on the Web. If you are seriously interested in being in the top league, you will need to learn all the tricks of the trade. WordPress 2.7 Cookbook focuses on providing solutions to common WordPress problems, to make sure that your blog will be one of the ones that stay. The author's experience with WordPress enables him to share insights on using WordPress effectively, in a clear and friendly way, giving practical hands-on solutions to WordPress problems, questions, and common tasks ñ from themes to widgets and from SEO to security. Are you feeling limited with WordPress, or are you wondering how popular blogs do a certain kind of thing that you can't? With this cookbook, you will learn many WordPress secrets and techniques, with step-by-step, useful recipes dedicated to achieving a particular goal or solve a particular problem. You'll learn the secret of expensive premium themes, how to optimize your blog for SEO and online profits, and how to supercharge WordPress with killer functions used by the most popular blogs over the Internet.
Table of Contents (17 chapters)
WordPress 2.7 Cookbook
Credits
About the Author
About the Reviewers
Preface
2
Finding and Installing Themes
Index

Displaying any RSS feed on your blog


Let's use my personal example—I have two blogs, catswhocode.com and wprecipes.com. In order to get one blog to promote the other, and vice-versa, why not put a list of posts from one blog in a separate page or in the sidebar of the other.

Let's see how we can display any RSS feed on a WordPress blog, without even using a plugin.

Getting ready

Do you know that WordPress has a function, called wp_rss(), that is simply a built-in RSS reader? It is used on the WordPress dashboard, to display news from the WP team.

How to do it...

  1. Edit your sidebar, or create a page template (refer to Chapter 3 for using and creating page templates).

  2. Paste the following code where you'd like to display the feed item. It can be a page template, your sidebar (sidebar.php), or your blog footer (footer.php):

    <?php
        include_once(ABSPATH.WPINC.'/rss.php');
        wp_rss('http://feeds.feedburner.com/wprecipes', 3); 
        ?>
  3. Save the file and visit the page that you just edited. It...