Poiesis Web Development » 2009 » June

Archive for June, 2009

PHPMost WordPress themes have a copyright notice in the footer like the one we use: © Copyright 2003-2009 Poiesis Web Development. The copyright notice is fine for the first year, however, it needs to be updated every January, or your blog begins to look old and unprofessional. Maybe you’re growing weary of having to open the footer.php file to manually change the copyright year every January. Well, since WordPress is based on PHP, there’s a simple solution called the PHP date() function.

The date() function

The PHP date() function returns the current timestamp as a string that can be formatted to displayed particular elements of the timestamp, such as the day, the time, the year, etc. In this post we’re interested in the year and there are two PHP format for year: 'Y', which represents the full year, as in 2009, and 'y', which represents the last two digits of the year, as in 09. The format that we use in the four digit format ('Y').

Continue reading “Automatically Changing the Copyright Year in Your Footer” »

Tags: ,

Display RSS FeedRSS feeds are quite handy. You subscribe to a feed that can be read using an RSS reader, such as Google Reader; and they can be displayed in e-mail applications, such as Microsoft Outlook 2007 and later. But they can also be displayed on your blog!

How? You might ask? Well, it’s really simple. Just copy the following code and include it in the .php file of the page in your WordPress theme where you want the RSS feed to be displayed.

<?php include_once(ABSPATH . WPINC . '/rss.php');
wp_rss('http://feeds.feedburner.com/PoiesisWebDev', 3); ?>

This could be your theme’s sidebar, footer or a page template.

Continue reading “Displaying an External RSS Feed on Your Blog” »

Tags: ,

WordPressWe’ve recently upgraded our WordPress installation to WordPress 2.8 and realized just why I hate upgrading WordPress! On the 2.7.1 version the NEXT POSTS / PREVIOUS POSTS link at the bottom of the page worked perfectly, but after the upgrade it pointed erroneously to http://www.poiesis.co.za/index.php/Index.php/page/2/. I’m sure you can see the problem there: the double index.php in the URL! The solution to the problem is simple: open the formatting.php in wp-includes and add the following line in the function clean_url after the if ('' == $url) return $url; statement:

$url = str_replace('index.php/Index.php','index.php',$url);

Continue reading “Double index.php problem” »

Tags: ,

WordPressWe’ve received a few queries about the next/previous link in our WordPress themes from people wanting to know how to implement it in their themes. Well, the answer is simply insert the posts_nav_link() template tag into the php files of your theme that has the if ( have_posts() ) : while ( have_posts() ) loop. These files include index.php and archive.php. When you use the posts_nav_link() tag the next/previous links are generated automatically when required. However, the tag only works for pages of posts.

Continue reading “Next-Previous link not showing?” »

Tags: ,