Get Date from posts or mySQL for Plug-in mod.
-
I’m trying to mod an existing WP plug-in, the goal to pull the specific posts date, and insert it into the a href tags/links that were posted in that blog entry. The “link” is already there, and my interjecting this custom attribute is already taken care of and works. What doesn’t work is the date part. I’m just trying to copy the date of that specific post into the HTML link that is on the blog entry.
In other words what used to be
<a href="whateversite.com">click</a>
on original blog post, now becomes<a href="whateversite.com" alt="$date">click</a>
in each blog entry (this will mod all visible blog entries to do the same)where $date is from that specific day’s entry. The mod does insert the alt attribute into the a href tags, what it won’t do is insert that post’s date. I’ve tried using
alt="post->$post_date"
but that didn’t work. $post_date by itself just repeats $post_date. I suppose I could be missing a require/link in WP, but you’d think a WP Plug-in would have that already taken care of (though I’ll admit this plug-in’s function wasn’t really intended for this use).Any ideas what I’m missing?
- The topic ‘Get Date from posts or mySQL for Plug-in mod.’ is closed to new replies.