The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
2answers
32 views

Using WP_Query To Get Posts Randomly From today

In the logic of the data_query(); I found this WP_Query sample: <!-- Second Senses Featured --> <ul id="featuredSecond" class="featured-second"> <?php $today = ...
15
votes
4answers
12k views

How to get WordPress Time Zone setting?

Can someone tell me how to get the time zone that is set in the WordPress Admin? For example, if the blog is set to Eastern time, I need this exact string to print out: US/Eastern This is for a ...
3
votes
2answers
83 views

How to schedule multiple posts while adding new

In a WordPress powered news portal, they need to upload many news at a time on a certain period of a day, in most of the cases, after 10pm (today). But they are actually inserting news for the next ...
0
votes
0answers
31 views

Ordering posts having multiple post-meta date fields

Hello WordPress developers. Over the years, I've found answers to many questions I've had with WordPress. I want to thank you for your help. Today, I have a question myself, and seek for expert ...
0
votes
2answers
266 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 ...
2
votes
2answers
196 views

How do I create a dynamically-updated copyright statement?

I'd like to find an optimized, WP_Query-safe method for generating a dynamically-populated copyright statement for the bottom of my themes. That is to say, I'd like to check the date (by year) of my ...
0
votes
0answers
42 views

How do you add Author and date Published on Category Pages?

I made a category on my Wordpress site. when i write any post and tag it in the category, the post displaying on the category pages in a neat way, everything is fine. But Google webmaster tools are ...
0
votes
3answers
4k views

Display posts starting from today date

How to display a list of posts from today date to future? I am actually using this code: <div id="news-loop"> <?php if (have_posts()) : ?> <?php ...
1
vote
2answers
11k views

How to get date for each post?

while (have_posts()) : the_post(); //some html <li class="icon-date"><?php the_date('Y-m-d');?></li> <li class="icon-time"><?php the_date('H:i:s');?></li> With ...
1
vote
1answer
39 views

Date query not inclusive despite parameter being true

I've set up a small test query to get some posts from October 1 to October 10. I published a post today ( October 10 ) and with the date query parameter of include set to true, I would have expected ...
0
votes
1answer
77 views

Relative time - how to calculate difference beween post publish date and current time

I want to calculate the difference between post's publishing time and current time, and I want to read that value as a number (number of hours, minutes, seconds whatever, i just want it to be a ...
1
vote
1answer
247 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 ...
0
votes
0answers
26 views

How to display time when page is created and edited

On posts I use this: Time created <?php the_time('Y-m-d'); ?> Edited (updated) <?php the_modified_time('Y-m-d'); ?> It works fine on posts, but on page template it displays just ...
1
vote
1answer
148 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
56 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
381 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
30 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
33 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
78 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
49 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
80 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
16 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
85 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
230 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
30 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
185 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
90 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
135 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
349 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
48 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
64 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 ...
6
votes
3answers
4k 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 ...
0
votes
1answer
95 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" ...
2
votes
1answer
248 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
65 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
842 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
60 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
59 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
110 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
151 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
75 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
140 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
350 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
73 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
186 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
42 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: ...