July 7, 2007

7-7-7 - WordPress Hell

Tagged as:

July 7th is upon us, and I've got my new theme up.

Mostly.

It still needs some work (like a few sections of the sidebars and some h2 color issues) but I'm pretty much happy with it. I'm not happy with WordPress, though. On the single.php post page, I had the post's date and time in the sidebar, but those only work in The Loop (what I have in the top section.)

Surely there should be a way of calling the date and time outside of the loop.

I mean, I can call the number of comments, the author, and even the page views outside of the loop, but I can't call the date and time? Something's not right about that.

Anyway, I'll be spending some time over the next few weeks tweaking things, and I may actually see if it looks halfway decent in Internet Explorer. Which means getting rid of the .png images I'm using and making them into .gif's.

Feel free to let me know what you think.

Post Information
david's picture
This article was written by david and published on
July 7, 2007 at 9:49am.
The article was given the following tags:
Comment Information
Guest's picture
Jeremy Johnson
Sep 4, 2007
3:35am

Did you ever get the date/time thing figured out? I had to write a custom plugin to pull it from the database and was wondering if there was a better way.

- Jeremy

Comment Information
david's picture
david
Sep 4, 2007
3:39am

Nope. I just gave up on it (and put it in the box in the entry.)

Haven't looked into how WP 2.3 handles this.

Comment Information
Guest's picture
Jeremy Johnson
Sep 4, 2007
3:44am

Ah, well I'll post my solution in the event someone stumbles upon this and needs a solution:

function getPostTime($postID, $format = 'F j, Y')
{

global $wpdb;
$postDate = $wpdb->get_var("
select post_date
from wp_posts
where ID = $postID");

return mysql2date($format,$postDate);
}

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options