Posts tagged: echo
Multiple the_date() Functions Return Empty Date
Inside the loop, if you use the function the_date() to display the date the post was published, you may run into trouble. Specifically, if there are two posts published on the same day, the second one will return nothing for a date.
Global Custom Fields
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
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 required2, but you should include a copyright notice on all published works3. So it’s a good idea to display a copyright notice on all of your blog posts and pages.
Dynamic Copyright in your WordPress Footer
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 (most likely