Note: This blog article has been superseded by the article at http://www.learncpp.com/?p=30.
I added a “recent news” box to the front page of the site, which shows the most recent items posted in the News category. It’s the easiest way to find the most up to date news about the site or the C++ Tutorial.
For you Tiga fans who would like to add your own recent posts box to your Tiga-themed web site, here’s how you do it.
- First, install the customizable post listings plugin. This plugin is what does the work of listing the posts.
- Second, download the newspage page template and extract it to a local directory. This newspage page template will only work with the Tiga theme.
- Third, edit the newspage.php file with an editor (for Windows users, wordpad works fine). You will see a line that looks like this:
<ul><?php c2c_get_recent_posts(5, "<li>%post_date%: %post_URL%</li>", "4"); ?></ul>
Change the “4” to the category ID of the category you want the box to display posts from. If you want the box to display posts from multiple categories, change the “4” to a space separated list of category IDs.
- Upload the template into your wp-content/themes/tiga-06/ directory.
- Go to your WordPress Administrator. For each page you wish to have a recent posts box: Edit the page. On the right side, you should see a “Page Template” box. Select “Newspage”. Save your page.