Template Editato By Force Downs

The WordPress Expert

The WordPress Expert


How to Fix Missing Post Dates in Your WordPress Theme

Posted: 26 May 2011 07:41 AM PDT

The problem:
When you have multiple posts published on the same day, the post date only shows up for the first one when you view the posts on your site.

The fix:

  1. Go to “Appearance > Editor” and repeat the following steps for each of your theme files
  2. Look for instances of this code:
    <?php the_date(); ?>
  3. Replace that code with this code:
    <?php echo get_the_date(); ?>
  4. Click “Update File”

The explanation:
Most WordPress template tag functions that start with “the_” will merely output the values returned by their equivalent “get_the_” functions. However, “the_date()” is an exception to this standard because it adds functionality that’s not present in “get_the_date()”, namely, not outputting the same date more than once per page, which can be a feature or an annoyance depending on your desired functionality.

New URL and Site Design

Posted: 26 May 2011 07:40 AM PDT

My “WordPress Expert” blog recently got a redesign and has moved from wordpress.jdwebdev.com to johnlamansky.com/wordpress, joining my technology how-to blog which is now located at johnlamansky.com/tech. I decided it would be nice to consolidate my blogs under one domain name, plus the “jdwebdev” domain didn’t make much sense anymore since I’m no longer seeking out new web development clients.

For you RSS subscribers out there, the RSS URL will remain the same for now, and if I do change it, I’ll be sure to 301-redirect it so you don’t have to update it manually.

The new design isn’t anything too fancy since I’m definitely more a developer than a designer, but if you have any comments I’d be interested to hear them. It’s my first time developing a WordPress theme from scratch instead of basing it off another theme (e.g. Sandbox).

No comments:

Post a Comment