The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
52 views

How to get the posts published in last two days using WP_Query?

I am trying to loop through all the post to get the top most shared posts on social network. I want to use the date_query parameter in the WP_query to get the posts of last two days , last 5 days, ...
0
votes
1answer
19 views

automatic send email at custom time

I want to send an automatic email every day at 10:00 I tried this code $timeN = date('H:i'); $timeS = date('10:00'); if ($timeS == $timeN) { $to = get_option('admin_email'); $nfrom = "my ...
12
votes
2answers
350 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 ...
0
votes
0answers
24 views

Menu of the Day?

I would like to show on a specific page a menu of the day, as well as a month calendar with the foods for each day listed. My current setup uses a plugin(Role Scoper) with some changes of my own to ...
0
votes
1answer
22 views

Block post updates and deletion after a set period

Trying to adapt the code from here to my use case: function wpbeginner_restrict_editing( $allcaps, $cap, $args ) { // Bail out if we're not asking to edit or delete a post ... if( ...
0
votes
0answers
63 views

WP_Query Sorting Posts by month … timeline effect

Hoping someone can take a look at my code and help me out. Right now I am trying to show my blog in a timeline style approach. My current query is generating the posts how I would like them to but I ...
0
votes
2answers
46 views

Change the date and time in wordpress

Is there a way to change the date and time in WordPress, not the timezone, but the date and time all together, like make it 03-21-85 11:11 PM. I want all dates and times to be changed, not just to one ...
2
votes
2answers
2k views

How would I bulk change posting date?

How would I bulk change posting date? I want to change about 20 post publish dates at a time in one click
0
votes
3answers
57 views

Show different time stamp based on time

What's the best way to show a time stamp based on different times? For example: if a post is under 24 hours, show %% mins/hours ago. If a post is over 24 hours, show month/day/time. If a post if over ...
0
votes
0answers
14 views

Change the date format

Sorry I'm newbee of wordpress. I want to change the format from Fri, 4 Oct 2014 to 04/10/2014. I changed the format from general - settings but still looks like same. I've already check this post : ...
0
votes
1answer
67 views

Default Timezone setting in WordPress - is that global?

Despite the WordPress Options' Timezone setting for the whole WordPress installation, is it necessary to declare the default timezone in all the date/time places in a WP theme/plugins? ...
2
votes
1answer
189 views

Custom Field sort not working (WP 3.8.1)

I am trying to sort a custom wp_query using the date format YYYYMMDD (php: date('Ymd') ). This will not be regarded as date field, but rather as a numeric one stored in custom field. My WP-QUERY code ...
1
vote
0answers
25 views

2 weeks ago from meta query meta value

This is my meta query within my posts query. 'meta_query' => array( array( 'key' => 'rw_membership_ends', 'value' => ??????? ...
0
votes
1answer
126 views

How to add a date creation field when a custom taxonomy relationship is created?

I need to display a list of posts and order it by date. The date of when the taxonomy term relationship was created. Is this possible? If so, how can I approach it? Thank you. EDIT - SOLVED! ...
0
votes
1answer
72 views

Replicate the_date function when using a custom field

I used to use the published date to sort posts on my page. Now I am sorting the posts with a custom date/time field. When using the published date I used the_date function, which only shows the date ...
0
votes
1answer
108 views

Date is wrong on 'all posts' page

The website i'm working on has a homepage with posts and at the end of the page a button with view more posts. When I click that button it sends me to 'all posts'. On this page I have a problem, the ...
1
vote
1answer
230 views

Advanced custom fields: Customise date picker's start date (need to choose year 1500 onwards) [closed]

In Advanced custom fields, I would like to customise the date picker so that, ideally, I can only select a year in the 1500s/1600s but at the very least allow the datepicker to go back to the 1500s. ...
1
vote
0answers
42 views

Display date and time in comments

I use wp_list_comments(); to display a list of comment in WordPress. But it does show the format characters instead of the correct datetime. How can I fix this bug? Thank you.
0
votes
0answers
55 views

Widget on home page displays wrong time compared to same widget on inside pages

I am trying to use the timely events calendar and I have the upcoming events widget on my home page widget area. The time that displays is not the time I have selected. When I put the same widget to a ...
5
votes
3answers
3k views

Converting timestamps to local time with date_l18n()

I've got a WordPress cron job that sends an email periodically and saves the timestamp when it was sent as an option, and I'd like to display a date on a settings page. Something like, "The last ...
1
vote
1answer
76 views

How to get date using timezone saved in options? [duplicate]

This code does not work correctly and returns time using timezone from computer and ignoring timezone stored in WordPress options: date_default_timezone_set( get_option( 'timezone_string' ) ); $hours ...
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" ...
0
votes
2answers
163 views

How can I show many posts an author has per week?

I've searched around and have had no luck or success in finding a way to show how many posts an author has made in a certain period of time (e.g. - a week) Any ideas on how one would approach this? I ...
1
vote
1answer
188 views

Wordpress Custom Query to show posts from last x years

I have found a way to show all posts from the current year with this code: <?php $today = getdate(); $lastyear = $today[ 'year' ]; $args = array( //'nopaging' => true, 'paged' => ...
0
votes
0answers
59 views

Save user login date

I want to save the last login date but it doesn't work properly. It saved the first time I logged but then when I logout and loggin it doesn't change the last login time. (Stay the same) add_action ( ...
0
votes
1answer
617 views

post_date_gmt and post_date [duplicate]

I am inserting posts programmatically using wp_insert_post. A typical call would look like this: $news_item = array ( 'post_title' => $titleField, 'post_content' => ...
0
votes
0answers
38 views

Fetching Post based on date

I am creating a website for fetching post based on date, So when the page load it display the post of current date and in that page there are two button Previous and Next so when the user click on ...
1
vote
1answer
49 views

php console log speed [closed]

How do I log speed benchmarks to a console in php? I don't want to echo the results for the user to see, but just in some kind of log. I know that I can get the time elapsed with this: $first = ...
0
votes
3answers
52 views

Comparing Dates from custom field

I am trying to compare dates from a custom field. I have them stored as something like "20121125". If the date has expired, a placeholder image will be used, if not, the default thumbnail will be ...
0
votes
1answer
92 views

change the post time on multiple posts

I have about 60 posts queued and ready to post on specific dates, but I forgot to set the post time. I really don't want a bunch of posts posting at 3AM, so I need to change the times on all these ...
0
votes
3answers
2k views

I get “The PHP Date/Time library is not supported by your web host.” on my CentOS host, what library to I need to install to add support?

I did some quick looking around, but my PHP skills are pretty nascent. I am sure there is just a package that needs installing. Edit to add additional information about the setup: Using: yum info ...
0
votes
2answers
122 views

How to second orderby in “pre_get_posts” by meta value or combine single date and time to timestamp

This is somewhat of a continued problem from another question that I had asked. Here is the original post. pre_get_post filter returns results when there should not be Since then I added an orderby ...
0
votes
1answer
73 views

Redirect to URL if x number of days passed

Let's say I have this URL: www.example.com/myCPT/post, here I want to check if 3 days has passed since the post was created to redirect to www.example.com/myCPT/post/stats. In this 3 days time frame ...
0
votes
1answer
131 views

Sorting meta box values by start- and enddate and all dates in between

What I've been attempting to write is a function that will allow me to sort a list of WordPress posts by their meta values start date, end date and all dates in between. I've set up a custom metabox ...
0
votes
1answer
281 views

Time sort with meta_key using UNIX timestamp failing due to date differences

I'm dealing with the following issue trying to sort a custom post type by a meta key created using the Advanced Custom Fields plugin Date and Time Picker add-on. The add-on creates a jQuery datepicker ...
0
votes
1answer
63 views

Should I escape the attributes when using get_month_link?

I am not sure should I use esc_attr() with get_month_link() like this: <a href="<?php echo esc_attr( get_month_link( get_the_time('Y'), get_the_time('m') ) ); ?>"> <?php the_time( ...
2
votes
1answer
165 views

Display post links under month in paginated archive

I'd like to create an archive that lists posts under a month header. The months would just be plain text and the post titles, obviously, would link to the posts themselves! So: October 2013 Post ...
0
votes
0answers
40 views

publish posts immediately when updating

i'm looking for a way (maybe a plugin) to have a choice of just updating an already published post, and updating and republishing it with a current date and time basically, two options when editing: ...
-1
votes
1answer
162 views

get posts based on category and post meta

I am coding a Live Show box for a radio website to show who is on air and who is up next. I've been using the get_post function to retrieve posts based on the category (in this case the day of the ...
0
votes
1answer
134 views

Compare WP Custom Field date

I had create a custom field "date" with this format 16/09/2013 (d/m/Y). How can i compare date and show only post with date from today ? This is my query that don't work !! $args = array( ...
0
votes
0answers
18 views

Change core metaboxes labels [duplicate]

I am creating the oh-so-common Events custom post type and I want to use the published date as my event date. Eventually, in my archive, I will make sure to display posts with the scheduled status. I ...
2
votes
2answers
98 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
2answers
147 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 ...
1
vote
4answers
5k views

Proper formatting of post_date for wp_insert_post?

What is the proper way to define the post date when submitting a post from the front end using wp_insert_post (Trac)? My snippet now is publishing with the mysql time... if (isset ($_POST['date'])) ...
0
votes
1answer
39 views

Access last visit time to a post

Is there any function or a way to access the time of last visit to a post by a visitor?
3
votes
3answers
965 views

Set Custom Post Type title to the Post's Date

I have a custom post type, called 'status' and I have disabled 'title' in the post type. Right now it's setting all posts to have the title "Auto Draft". I want to set up a way to set the title to be ...
0
votes
1answer
402 views

Get date function not working

I have a function to get the date. I have input fields and want the date in this fields. But my code is set a wrong date. I set the date in Wordpress settings and on my server. But it is not working. ...
0
votes
1answer
120 views

How do I convert all custom_field php timestamps in the database to js timestamps?

For the past year, we've been storing date-time values into a custom field _date using strtotime(). There are about 100 PHP date-time stamps in our database from over the past year. I would really ...
1
vote
0answers
243 views

date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)

I got used working with the More Fields plugin. But it seems that fields like datepicker timepicker date/timepicker image upload (media library) are missing somehow. Is there a plugin which can do ...
1
vote
1answer
221 views

If modified on same day, show only time

I have a date on each post and comment which shows the date of placement. If I edit it, it shows me the date of the post and the modified date. That's fine, but now, I want to show only the post date ...