DiggingIntoWordPress

by Chris Coyier & Jeff Starr

Tag: echo

Global Custom Fields

Posted by on

UPDATE: Make sure to take out “Take Two” on this concept, with a cleaner method for doing this.

Custom fields allow us to attach data to Posts or Pages that we can yank out and use at will in our templates. They are awesomely flexible and single-handedly allow WordPress to be used for about any CMS need. The fact that they can only be used on single Posts can be limiting in some circumstances. Sometimes you wish you could grab a custom value that you can control and is consistent globally, regardless of the current post. In this post we’ll look at a technique to do so.

How to Display a Copyright as a Range of Dates

Posted by on

Technically, your work is protected under copyright “the moment it is created and fixed in a tangible form that it is perceptible either directly or with the aid of a machine or device.” [1] Registration of your copyrighted work is not required [2], but you should include a copyright notice on all published works [3].

Dynamic Copyright in your WordPress Footer

Posted by on

Many footers on websites contain text like “© 2009 Your Website”. A good measure, surely. We can use some classic PHP and a built-in WordPress function to make this bit of text dynamic so that it will never need to be tampered with manually again. Here is the code to add to your theme template file (e.g., footer.php):

Code is poetry