Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [date]

The tag has no usage guidance.

0
votes
2answers
55 views

Way to display “Yesterday”, “Today”

I currently use the following code below in my loop to display dates for groups of posts. Works great, was just wondering if it's possible to change the day from php code 'l'(Sunday-Saturday) to Today ...
0
votes
0answers
21 views

PHP 7.2 Upgrade Issue: Published Date Showing As Current Date on Front-End of Posts

So we recently noticed that the post date on our posts is showing up as the current date. For example here: https://www.chrisapappas.com/2019/02/11/grammys-2019-best-dressed/. All our posts are ...
1
vote
1answer
15 views

Show post updated date instead of published

I need simple solution to show updated date instead of published without adding any functions. I have read few articles, but they are bit complex using "dirty" code. This is my current code is it ...
0
votes
1answer
9 views

Tumblr imported blog showing wrong date

I imported my Tumblr blog to Wp but all my blog are showing the preceding date as the date of publishing. I even changed the timezone of my wp account to my location before importing but the problem ...
1
vote
2answers
13 views

Same date is repeating on my custom 'Most Recent Posts' on sidebar

If you look at the 'most recent posts' on my sidebar for my posts page, you can see that the 'date' is repeating. The code and page is below. Any help would be appreciated. Thanks! https://...
1
vote
1answer
43 views

Remove “at” string from wordpress comment date

I'm using the following code to format the author's comment date and remove the time: function my_change_comment_date_format( $date, $date_format, $comment ) { return date( 'd M Y', strtotime( $...
0
votes
0answers
10 views

Wordpress contact form 7 compare dates

I am using a contact form 7 plugin. I have two dates fields - date-from and date-to. When I am clicking on date-to,i must calculate the difference between date-from and date-to with jquery function. ...
0
votes
1answer
149 views

ACF Date Form in Custom Admin Field

I have this function code, that brings in a ACF date picker data, and adds it to the columns view. It;s raw format is YYYYMMDD My next step is to change the format of the date to, Day Month Year so ...
0
votes
0answers
24 views

Problem with my loops

I am French. Sorry if i make mistakes. I have two problems. The first, I have a page that shows all paying activities sort by date. The 'posts_per_page' does not work When I put 10, it shows 8 ...
0
votes
1answer
22 views

Get system timestamp in wordpress

My system timezone is UTC+1, MySQL is using this timezone and it's ok. Now I want to get the same timestamps in WordPress. As you know, WordPress modifies the current timezone so time() returns UTC-...
1
vote
2answers
15 views

Print last modified date only on posts

I'm printing the last modified date via functions.php with the following code function wpb_last_updated_date( $content ) { $u_time = get_the_time('U'); $u_modified_time = ...
0
votes
0answers
28 views

Convert number to date format within an array

I have a custom field of deal_date that I need to work into an array. When using directly on a template I can just set the output format directly in the ACF UI. However I obviously cant use get_field ...
-1
votes
1answer
28 views

remove author and date from all posts [closed]

I've tried including some code in style.css of my theme, but it didn't work. Ex: body.blog .posted-on, body.blog .post-author, body.blog .post-comments, body.blog .entry-taxonomy { display: none; }...
0
votes
1answer
16 views

Display Updated Date Instead of Published Date

Both published and updated date are showing on the post page. How can I replace the published date if the last date is updated? The code is here: Published on <a class="entry-date" href="<?php ...
1
vote
1answer
9 views

Set the publication date independent of the scheduled publication date

I want to write a post today (2019-01-15) I want to schedule the publication for the future (2020-09-03) I want the published date to reflect when it was originally written - so it appears as example....
1
vote
1answer
125 views

WP_Query meta_query >= date

I have been trying for hours, I don't get my query to work: display only posts (from custom post type) with a field (Advanced Custom Fields date picker) value that is more than today. echo date('d-m-...
0
votes
0answers
47 views

How to sort wordpress posts by distance and date

I want to sort wordpress posts by user's distance from posts location and by date by using some calculation..Here is the formula. 2*log(distance) - log(time in seconds) I saved post's latitude and ...
0
votes
1answer
9 views

Can't add to time? [closed]

What's the best way to add to time()? For example: time() + 5 will return 5, not the current unix timestamp with 5 added to it. Any ideas? Thanks
0
votes
1answer
32 views

How to update all posts at once?

Like "after host change, we update our permalink"
0
votes
0answers
18 views

Timezone for Plugin

I'm using these two lines: $expires = strtotime( $_POST['expire_date']); if($expires < time()) to test the time in the name=expire_date form against GMT time. But no matter what I do my expire ...
0
votes
2answers
28 views

Conditional: IF post creation date is in the first half OR last half of the year [closed]

I'm trying to find a way how to have a simple conditional whereby I can echo something depending on whether the post date is in the first half or last half of the post date year.
0
votes
1answer
22 views

How to get Unix Local Time?

I have a given time and I'd like to confirm that is AFTER the current time. $expires_epoch = strtotime($_POST['expiry']); if($expires_epoch < current_time('mysql')){ ...do stuff... This snippet ...
0
votes
0answers
21 views

Wpforms snippet condition date+7

I want to limit the input in a datefield to (minimum) today+7. I found the snippet below, but i don't know how to customize it. Anyone that can help? (Sunday may be available) /** * Limit the dates ...
0
votes
1answer
38 views

How do you update post date (year only) in a separate custom field?

I would like to update all my posts with a custom field that stores the year the post was published. The "year" value will obviously be retrieved from the post's date meta data. I will then use the ...
1
vote
1answer
17 views

Adding number to date not working [closed]

I am adding number stored in custom user meta data to current date. Here is my code $addeddays = get_user_meta($this->order->user_id, 'xxx', true); $timeBase = date('j.n.Y'); echo date('j.n.Y', ...
0
votes
0answers
55 views

Sort posts on custom field AND after that sort on date?

I'm having trouble to understand customizing the new WP_query. I've found the script below, partly, here in order to get the sticky posts. I've further edited it in order to: first get the (sticky) ...
0
votes
1answer
131 views

How do i search post by jquery datepicker?

I'm working on the WordPress website I have my own search filter page, where I added the jquery datepicker, now I want to search post by datepicker? Html Code script> $(function() { jQuery( "#...
1
vote
2answers
56 views

Set meta field to publish date + 2 weeks

I have a meta field called postexpiry, and I want to set the value to the publish date, + 2 weeks. So if today were October 3rd, I want the field to be set to October 17th. I was thinking about ...
-1
votes
1answer
29 views

How to randomize published date for WordPress custom post type

I have tried the following answer to randomize post published date: Update existing post dates to random dates It worked but I need to randomize custom post type. How do I do that? Example: post_type=...
1
vote
0answers
58 views

How to show recent and upcoming birthdays using meta_query

I have a date of birth user field, I am trying to show recent (past 7 days) and upcoming (next 7 days) birthdays. I have the below but it is not working because the years in the date of births are ...
2
votes
1answer
414 views

Use meta_query to display events by date in custom field

I'm working on a template for a specific category archive of the custom post type event. I need to make a query that shows future and ongoing events, ordering by a date in custom field. $termName = ...
0
votes
1answer
23 views

Grouping posts by date

I am trying to group my posts on the index page by date. For example: Date 1 Post 1 Post 2 Post 3 Date 2 Post 1Post 2 Post 3 For some reason, I keep getting the posts under each date. Here is my ...
0
votes
1answer
661 views

Add Date and Author to Posts

I need to add the date and author to blog posts. The line needs to read like this example: Posted on January 20, 2018 by Name Clicking on the date will take you to a page with all posts published on ...
1
vote
0answers
36 views

Make WordPress use timezone for email Date header

My WordPress installations send emails with the Date header specified in UTC: Date: Wed, 18 Jul 2018 15:18:50 +0000 I would prefer that the mail be sent with dates encoded in localtime, which is ...
2
votes
1answer
139 views

WP_Query meta_query results date by date

Don't leave! This isn't another question about how to orderby meta_value! I have a post type called events, and each post I create has a meta field I imaginatively called event_dates_wp which accepts ...
0
votes
1answer
46 views

How to Convert Date to Thai

The Thai text I want to end up with is: อาทิตย์ 03 มกราคม 2016 to อาทิตย์ ๐๓ มกราคม ๒๐๑๖ I don't think it should matter what language but in this case it is Thai. My function is: $strdate = ...
2
votes
2answers
776 views

Custom Post Types - How to include custom fields

I'm fairly new to wordpress and the content management system. I've been following a couple of tutorials to get started. I've been searching for specifically how to include a date picker in the add ...
0
votes
1answer
358 views

Wordpress returns a wrong date

I am trying to get the todays date , day and time . Today is : 10th july 2018,tuesday and time is 3.23am For time the below code works fine: $wpplcurrenttime = current_time( 'g:i a', $gmt = 0 ); ...
1
vote
0answers
36 views

WordPress Date with ACF

I am using Advanced Custom Fields using the Relationship field type and I am struggling to get the date of the post to come through. https://www.advancedcustomfields.com/resources/relationship/ ...
0
votes
0answers
17 views

Changing the date of new posts

I'd like all new posts that are created via the admin interface to have a date set in the future. For example, if I'm creating a post now, I'd like it to default to "scheduled for tomorrow". I found ...
1
vote
1answer
328 views

How to add 2 hours to the wordpress time formed with current_time(“mysql”, false)?

How to add 2 hours to the wordpress time which has already been formed using current_time("mysql", false)?
0
votes
2answers
209 views

How to remove a link of date archive

I want to remove the link from the date, this link leads to archiving. I'd be happy to get help - thank you very much
-2
votes
1answer
31 views

In my Website homepage I want to remove date which is written along author name [closed]

Kindly tell me how should I remove the date written alongside all posts in Homepage.
2
votes
1answer
727 views

Get posts by meta value with date

I have a post type called "agenda" and one of its meta value is the date of the event. How can I get the posts of the current year based on the meta value? I tried this args above but it doesn't ...
0
votes
1answer
19 views

Worpdress function for difference dates

can I show for each posts the insert date like as '1 hours ago', '2 days ago', '2 weeks ago', etc.. Thanks in advance!
0
votes
1answer
42 views

How to hide post published date?

How to hide published date programmatically from all posts? I've tried adding filters, hiding some post metadata, but as I'm new to WordPress didn't figured it out yet. Can someone help me with this?...
1
vote
1answer
34 views

Use current date as tag?

I want to make a simple calendar in my wordpress. I want to show every day different posts, which have the current date as tag. For example, I put a tag 17-01-2017 in three posts. I want to get them ...
0
votes
0answers
128 views

WordPress change post date format from english to japanese

For my WordPress V-4.9.1 I want to change the Post date format from English to Japanese like DECEMBER 29, 2017 to 2017年12月29日. I know it is possible if I change the WordPress admin language but ...
0
votes
1answer
25 views

Assigning Two Different Post Dates For Single Post

I am using posts for listing my events. So i need to specify two different dates for my posts. I know there is only one post date, but i need to make it two to specify my events starting and ending ...
-4
votes
1answer
27 views

Why did my most recent article fall behind an older one on my site?

https://afrosapiophile.com/ This is is the face of my wordpress website. This article here: https://afrosapiophile.com/2017/12/25/side-eye/ Was written on the 25th of December. This article, the ...