The date tag has no wiki summary.
8
votes
2answers
168 views
Set post date before 1970
I have a custom post type called books. The books publication date is from between 1700 and 1900.
I want to set the post date to these dates(so i can query the results sorted by year) but i can't ...
6
votes
1answer
367 views
The purpose of the post_date_gmt?
Why do we have 2 date fields in the wp_posts? What's the purpose of the post_date_gmt? When does storing the greenwich time get handy?
5
votes
4answers
150 views
Display a post's publish date from 2112
So I am making a news website about the future, 2112 to be specific (hello, critics). I wanted to display a post's date to be from 2112. But when I try to do this from the admin panel, it 'schedules' ...
5
votes
1answer
1k views
using wp_update_post on save_post
im trying to update a posts date (-1 year), when you hit update. but it causes an infinite loop.
any other ways of doing this?
thanks.
function change_year($post_id, $post){
if ( ...
5
votes
1answer
158 views
User-Specific Timezones? Hack? Plugin?
Is there any way, whether it be a hack, a plugin, etc., to give users their own timezone? I am using a purchased SMS plugin. Users (my clients) login and are able to send out text messages when they ...
5
votes
1answer
320 views
WordPress Posts By Date/Day?
I want to output on the homepage the posts from the lastest 3 days.
Like this:
30/03/12
post 1
post 2
post 3
29/03/12
post 1
post 2
post 3
28/03/12
...
4
votes
1answer
55 views
Metabox date month number to word
I use custom metabox with date (day, month and year). The problem is when I try to transform date number to date word - for example 10 to be October. I use this code:
function ...
4
votes
1answer
72 views
Page permalink conflict with Date
I need to access a page which is name 2011.
The trouble is that WP thinks that I am trying to read the 2011 posts of my blog.
The only way I can make it work for the moment, is to change the ...
4
votes
1answer
59 views
Uploading DB to server from local is not matching the post dates
I just created a custom WP CMS and am having trouble with the custom post maintaining the correct order on the front-end. In the back end the date order is correct but is not being reflected on the ...
3
votes
4answers
728 views
the_date() not working
I am using wordpress 3.2 and I did a query post like this:
<?php query_posts("posts_per_page=1post=type&page=post_parent=10");?>
Then I try to echo out the date of this post I queried ...
3
votes
1answer
68 views
How to display date such “x ago”
I want display date based on how much time has passed since, i. e. Posted 12 minutes ago
3
votes
1answer
298 views
Post date vs. event date in Wordpress
If I'm creating a WordPress site, what should I do when I have a blog that manages events to keep date events? For instance, in my own case, I'm making a travel blog where some histories have a real ...
3
votes
2answers
3k views
How to get the post publish date outside the loop?
I need to pull out the post publish date in order to make the post post auto expire. The thing is I can't get the right publish date.
Here is my code:
global $wpdb;
$post_ids = ...
3
votes
1answer
149 views
Add 20yrs to post date, and then query
I would like to know if anyone knows a way of adding a timeframe (say 20 years) to the datestamp on a set of posts, and then running a query on the loop which uses the new date?
Basically what I want ...
2
votes
2answers
46 views
Get date of last update outside of loop
I'm trying to figure out how to display the date that a post was last updated outside of the loop. I'm able to display the published date using get_the_time() but there doesn't seem to be a "loopless" ...
2
votes
1answer
166 views
How Do I Make WordPress Run an Event Every Day?
In a plugin I want to build, it deals with contests. A contest has a date on it. Does WordPress have a feature in it where it can run a piece of code every day without requiring someone to create a ...
2
votes
1answer
217 views
How can I query all users who registered today?
I'm trying to use meta_query to return all users that have registered today :
$args = array(
'meta_query' => array(
array(
'key' => 'user_registered',
...
2
votes
1answer
209 views
Exclude Duplicate Posts in this SELECT Query
I have this custom select query that pulls a specified number of posts from a specific category and displays them in the order of the latest comments. The problem is that if a post has both of the ...
2
votes
1answer
18 views
How to integrate get_post_time with date_i18n function?
I have date format and would like to translate to another language with date_i18n function how can I integrate with get_post_time here is my code :
$time = get_post_time('F j, Y', ...
2
votes
2answers
116 views
Rearranging posts based on categories
Hey everyone on Stackexchange!
I'm trying to find a way to prioritize posts based on a category in a loop, which is sorted by dates. All posts are grouped under their respective dates. The date ...
2
votes
0answers
124 views
Custom Post Type Events Archive Grouped By Month
I'm currently trying to get my events listing code to print out headers by Month. So basically this:
October
event
event
September
event
event
etc...
Right now it just keeps echoing ...
2
votes
0answers
788 views
query_posts with a custom post type, a meta_query and sorting by post date?
I've searched the archives and found questions similar to what I need, but haven't found exactly what I want.
I've got a bunch of products that are sorted by a meta_key of country, and I'd like to be ...
1
vote
1answer
186 views
WP_Query() show posts that end later than today
I have a query as follows:
$wp_query = new WP_Query( 'meta_key' => 'end_date', 'meta_value' => 'today', 'meta_compare' => '>=', 'post_type=vehicle' );
I want to show only those posts of ...
1
vote
2answers
235 views
How to show the real post date in a draft
When looking at a draft post, get_the_date() only seems to return today's date, not the post date, even if I have selected another date on the post edit screen.
Is there a way to show the "actual" ...
1
vote
1answer
195 views
Schedule event every second thursday of the month
I'm working on an email system and they want it automated to send out emails every second thursday of the month. I've got the PHP sorted out and ready to fire a callback to send the emails, but I'm a ...
1
vote
2answers
22 views
Display post date as 04/26/2013
I want to modify the date display of the post entries from current format:
April 26, 2013
to this:
04/26/2013
Where in the code can I make this change?
Thank you in advance!
1
vote
2answers
53 views
Display commenter's registration date on comments?
Is there any way to display a user's (registered) registration date on the comment.
Lets say i have a written an article, registered users A, B, C and D left a comment on my article.
I can display ...
1
vote
1answer
386 views
How to sort CPT by custom meta value (date), and return posts month by month
For future reference:
I am using the great Meta Box Plugin to help expedite meta box creation for my custom post types.
My goal:
To build a highly customizable events section closely resembling a ...
1
vote
1answer
314 views
XML-RPC and post_date
I'm trying to set the post_date via XML-RPC and keep getting an error saying the XML isn't formatted properly. The code goes something like:
$post = get_post( $post_id );
$response = ...
1
vote
1answer
431 views
Automatically republish old posts
been seaching on google for a plugin for this and can't seem to find anything realiable. The only plugin I found is called "old post promoter". Any ideeas?
Can this be done with googl old fashion ...
1
vote
1answer
61 views
How to order posts of a custom post type by date DESC in dashboard Admin?
I created a new post type named "Video".
When I create post for the post type, posts is ordered by title ASC.
Is it possible to order posts by date DESC please ?
register_post_type('Videos', ...
1
vote
1answer
206 views
After wp_insert_post(), date_i18n() and date() outputs are adjusted to GMT
I am having a very peculiar issue on a customer's server (vps). The code below works just fine on my servers. Basically, a specific unix timestamp is formatted correctly and as soon as ...
1
vote
2answers
58 views
Displaying Archives List
I'm displaying list or archives using
<?php get_archives('monthly', '', 'html', '', '', FALSE); ?>
and my list displays
December 2012
November 2012
etc
However I would like to format ...
1
vote
1answer
186 views
Author List page: Exclude based on last post date
I have a Author page that I built using this code and it works fine. However, I have several writers that range from frequent to one-time writers. I would like to seperate out writers that have not ...
1
vote
1answer
124 views
Date calculations from 2 custom fields
We are struggling to find a way to calculate a time difference between two dates saved as custom fields on WP. We are actually using two different plugins:
a) Easy Content Types
b) Advanced post ...
1
vote
2answers
141 views
How to split <p> text text text </p> into array
I like to output and style in a shortcode, but the content that is get is the content of a page, so it's style like that
<p>2012-12-12</p>
<p>2012-6-23</p>
...
1
vote
1answer
430 views
Check if date of post is yesterday
In a loop, I want to display "Yesterday" if the date of the post(s) are dated from yesterday...
So here it goes:
<?php
if( date('Yz') == get_the_time('Yz') ) {
echo 'Today';
} ...
1
vote
1answer
38 views
Post preview gives 404 when permalinks are purely date based
I have an issue pertaining specifically to the situation in which permalinks are set to be based only on publication date. My permalink structure is as follows:
/%year%%monthnum%%day%/
When I try to ...
1
vote
1answer
88 views
Escaping date string in url with wordpress
I am creating a Wordpress page that searches through posts based on a date variable that is set through a _GET variable. I want to make sure that I am doing this in the best way possible and that I ...
1
vote
1answer
166 views
Archive listing of posts by publish year (multiple years)
I have an archive page showing all blog posts (in a specific category). With a growing number of posts, I want to separate these by publish year. For example (simplified), I'd like the following:
...
1
vote
1answer
26 views
date issue with category post retrival
I am trying to retrieve all posts from an rss feed from a category, and I have working code that does this. However, on one category I will only get all posts until a certain date. Any post prior to ...
1
vote
1answer
72 views
Sorting a query Field by date
I have my site, which at the moment is display university open-days, at the moment they are sorting by order of page title, when actually I would prefer they sorted in order of date, soonest first, ...
1
vote
0answers
177 views
How to set post expiration date and time and move the page to archive after expiration [closed]
My requirement is to move the certain posts from home page category after specified date and time.
I have two category News and Events. Both have so many posts and i dont want to show all the posts ...
0
votes
2answers
39 views
How to output comments number of a post per day?
I have a question about the comment numbers in a post... For now, I can output the total number of a comment inside a post outside the loop. That's cool enough, but I want to get show the comment ...
0
votes
1answer
30 views
Format Date for Manual Insertion into post
I have the following $mydate = "26 January, 2012, 5:05 AM";
I want to format this date properly so I can insert it into a post_date. Is there a simple way to do it?
$post_ information = array (
...
0
votes
1answer
47 views
Wrong date returned by get_the_time
I have this line of code :
$registration_date = get_the_time('F j, Y').' at '.get_the_time('g:i a');
I just ran this on my BlueHost hosted website and it returned : January 29, 2013 at 12:54 pm
...
0
votes
1answer
104 views
Get_the_date doesnt show todays date [closed]
I tried the_date, the_time and get_the_date to show todays date on the website. But wordpress takes latest post's date and publishes it. For example on the index page if the latest post was posted on ...
0
votes
1answer
74 views
Calculate future date
I want to calculate a future date based on the date the post is published and use it in the content of a post.
I can echo the post publication date using:
echo the_date('Y-m-d');
How can I ...
0
votes
1answer
12 views
Changing the post date and time with function
What function can be used to update a post's post date and time to the current date & time?
0
votes
1answer
60 views
month name translation
I use the birdtips theme and it formats the post date as
$birdtips_posted = date(__('Y. F j.', 'birdtips'), strtotime(get_the_time("Y-m-d")));
where Y. F j. is already rewritten to reflect my ...