The tag has no wiki summary.

learn more… | top users | synonyms

12
votes
2answers
362 views

Unable to select an old date in wordpress

I am unable to set the year below 1899 for a post. If i set year below 1899 it is set to the current year automatically. I have purchased the Timeline theme and asked in their support forum. They ...
10
votes
2answers
348 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 ...
7
votes
4answers
3k 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 ...
7
votes
1answer
1k 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', ...
6
votes
1answer
1k 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?
6
votes
2answers
149 views

Is it possible to Schedule Attachments in Wordpress?

As it's fairly well known, it is possible to schedule Posts in Wordpress for publishing. Also Attachments are actually Posts (in the more internal, technical meaning). So the question that bothers ...
5
votes
4answers
165 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
2k 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
395 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
481 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
2answers
11k 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 = ...
4
votes
1answer
106 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
86 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
56 views

Permitting Wordpress to accept dates outside of 1902-2038

I'm using Wordpress 3.9.2, MySQL 5.1.73, & PHP 5.3.27 to put together a history-based site. As is well-documented elsewhere (including many questions on StackExchange & WP forums over the ...
4
votes
2answers
197 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 ...
4
votes
1answer
70 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
552 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" ...
3
votes
1answer
76 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
2answers
1k 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', ...
3
votes
1answer
497 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
1answer
168 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
5answers
1k 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
716 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' ); ...
2
votes
1answer
385 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
117 views

How can I display a specific user's first published post?

I'm looking for a way to display a user's first published post using their unique ID. I have a function that calls a list of specific users using their IDs, and would like to display the date the ...
2
votes
1answer
73 views

How to stop a user from updating the post date

I have a custom role, called "dealer". Once they have posted a new post, they cannot delete it. It's important they cannot update the date either, and I'm a little stuck on how to do this. It looks ...
2
votes
2answers
102 views

Unable to set right time in admin and frontend template

When I run a simple php file called test.php (placed in the root of the wp installation) that contains something like that: <?php echo date('H:i:s'); ?> The result is right: 15:30:00 and the ...
2
votes
1answer
672 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
229 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
2answers
157 views

Date, Time, and Timezones

I am a bit confused about using dates/times along with timezones in WordPress. I have the following questions: What is the purpose of the timezone setting in the Admin -> Settings section? Assume ...
2
votes
1answer
203 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
1k 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 ...
2
votes
0answers
302 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 ...
1
vote
2answers
8k views

How to get posts published between a date and today?

Is it a way to get posts published between a date and today with query_posts() ? Example : All posts published since 2012-04-01 Thanks EDIT : How to add the filter date on this Query Posts ? ...
1
vote
1answer
463 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
1answer
133 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?
1
vote
2answers
65 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
1answer
1k 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
2answers
154 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
119 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 ...
1
vote
1answer
398 views

Get random posts between specific dates / of specific age

I need to get post IDs from a custom post type randomly and the posts are posted within 30 days. But I can't really find a solution. How can I do it? This is my query. ...
1
vote
2answers
349 views

Preventing 404 error on empty date archive

On a date archive page when no posts exist (for that date) WordPress throws across to the 404 page. Is there a way to make WordPress continue to use the original archive instead of the 404. That way ...
1
vote
1answer
257 views

Arrange posts by date in front page

I have code to show the 5 last posts from every category on the front page. However, at the moment they are ordered category by category. Is it possible to order them by post date, but still have 5 ...
1
vote
1answer
706 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
736 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
2answers
28 views

Fetch posts from current week (Sunday to Saturday)

I'm trying to fetch posts from current week. <?php $args = array( 'date_query' => array( array( 'year' => date( 'Y' ), 'week' => ...
1
vote
1answer
68 views

Ordering by meta_value AND date NOT WORKING with wp_query

I want to select posts and custom post type with a specific meta value (mb_home!=0), of last week and ORDER them by mb_home. If they have the same mb_home value, I want them to be ordered by date. ...
1
vote
1answer
59 views

Get list of years when posts have been published

I want to create a list of posts from a Custom Post Type and add some filters the user can click to filter the list. I added filters for all the categories by using the get_terms() function. Now I ...
1
vote
1answer
152 views

What's wrong with my date_query?

It's WordPress 3.9 "Smith". I'm trying to implement a new Archive page as per the suggestion of @Milo. $categories = get_categories( $cat_args ); //it's NOT important for the Q, as it's fetching ...
1
vote
1answer
355 views

wpdb update add current timestamp not working

So using the $wpdb->update to add some data to a custom table, trying to add the current timestamp but it's not saving the right stuff(0000-00-00 00:00:00 this is saved). overview code ...