0

I want to break the date mechanism in Wordpress. I need to have dates set in the 30 century, controlled through the regular post, but only for one category.

To give an example I'd like a post dated 21st of August, 2999, but published on the 10th of December 2014.

A search has not turned up anything that meets my needs. I'm using custom fields to record the date, but I don't know of a way of making it replace the blog's date for the chosen category. I'd rather not modify the loop or any code.

Does anyone have some suggestions how I can make this happen?

0

Why not changing the loop? Inside the loop, just check to see if the custom-field or post-meta which you provided for the custom date is filled or not and show the post date or custom date according to the conditions.

You can also have a special page for that category's timeline and a function for that specific page to make timeline using custom dates.

  • Sure, I'd like a custom date except my PHP is rusty and I've never worked with Wordpress's loop. I use WP as an easy way to post information about a Scifi game, but I lack the time for full on development. So if you can point me at a way to hack the WP loop I would appreciate it – Jamie Le Rossignol Nov 30 '14 at 8:49
  • Actually it depends on your theme! – mahdionnet Dec 1 '14 at 15:40
  • Find the place where the date and time is fetched to be shown in the post body. You can check "single.php", "Loop.php" or "functions.php" -depends on the theme- (tip: try searching the file for "date" or "time") and there you can check to see if the post belongs to that specific category or the custom field you'd provided is filled or not and show the corresponding result. – mahdionnet Dec 1 '14 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.