Stack Exchange Network

Stack Exchange network consists of 174 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 tag has no usage guidance.

1
vote
1answer
8 views

Adding number to date not working [on hold]

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
26 views

WP_Query sort posts with deadlines

We build our own CRM in WordPress and created a custom field for deadline (date). When we query this out, we want to sort these by the date and if no date is set, put that in the end. Is this ...
0
votes
0answers
27 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
0answers
13 views

Search Plugin expects different date format in DB - workaround?

I have two plugins: Events Manager and Search & Filter First one stores dates as YYYY-MM-DD in database, second expects YYYYMMDD format. What would be an easy workaround to get this working? ...
0
votes
1answer
51 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
49 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
24 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=...
0
votes
0answers
20 views

How can I display a desired date into a Wordpress page?

This question was posted on Stack OverFlow first. Discovering this Stack for WP Devs, I'm posting here too. Sorry if I should not duplicate. I'm trying to find a way to choose a date and display it ...
0
votes
0answers
55 views

how to add validation for min and max date range of contact form 7

I have created a date field using contact form 7 and set some min and max date range. It works fine with date picker widget but using keyboard it does not get the valid date. So I have created ...
1
vote
0answers
24 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 ...
0
votes
0answers
35 views

How to get the correct date depending on the current visitor timezone?

I want to change the date format for my custom post types from dates to time. So i starting using this code: echo get_post_time('g:i A', TRUE, get_the_ID(), TRUE ); It's working successfully but ...
2
votes
1answer
42 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
0answers
21 views

Change Background Colors of Post Rows in WordPress Admin Based on Last Modified Date

I would like to ask the following - how to color, for example, in red all the rows in Wordpress admin panel for the posts that have not been modified for more than 3 months (or 1 year for example)?
0
votes
1answer
13 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
101 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
25 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
74 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
41 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
256 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
174 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
26 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
15 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
66 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
66 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
30 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.
1
vote
1answer
348 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
0answers
19 views

How can I create a Custom Post Type Archive page by year that continues to include all years since the first post

I understand how to successfully create a Custom Post Type Archive page based on each year using this code: Current Year: 'year' => $today["year"]-1 Previous Year: 'year' => $today["...
0
votes
1answer
36 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
33 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
88 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 ...
0
votes
1answer
207 views

Convert Gravity Form Entry Date on Export

Gravity Forms offers a hook to modify field values when exporting an entry list using the gform_export_field_value hook. They show an example on how to change the User ID to the User Display Name on ...
0
votes
1answer
47 views

Unique Problem with the php date and get_posts

I have several date queries on an events page that outputs events posts according to the month and the year of the post. Each post has a custom date field in the form YYYY-mm-dd and a corresponding ...
0
votes
0answers
23 views

How to get the date of last updated post or page and put it in the footer

I want to show in the footer that my WordPress site has been updated recently, how can I show it on the the footer? There are codes that I find where they put the last update on the post, but I want ...
0
votes
1answer
93 views

Date Language doesn't change

i've switched to Italian Language for my wordpress website and it shows the translation correctly, but when i try retrieve date and time with this code echo "<span class='date' style='margin-left:-...
0
votes
2answers
74 views

How to hide meta from search result only on pages?

I have different content on static pages and post in my WP site. On pages is not desirable to view meta in search result, but in my post is important. Meta, I mean information about author, and date ...
0
votes
0answers
12 views

Add dates to various posts written on the same day [duplicate]

How I can put the date of various posts written in the same day. If I write various posts on the same day only show the date in the last post. The posts are in the in the front page into a loop. The ...
3
votes
1answer
497 views

How to display Last Updated date from the latest post for a category list

I've created a page on my site to simply list all the subcategories within a category using: <?php $args = array( 'show_option_all' => '', 'child_of' => ...
0
votes
1answer
42 views

How do I display posts ordered by a date custom field?

I'm trying to show post order by a date custom field that are displayed like this: Year Month Custom field post info(date, time, venue, and category) Title I found this ...
0
votes
2answers
244 views

Display published time for today's posts only

I'm building a blog theme. I know that the_date() and date() functions display published date of posts. And I know how to get posts' published time with the_time() function. I want today's posts to ...
0
votes
0answers
35 views

Force WP_Query to work in a local timezone [duplicate]

I have a template that displays an actual event if we have a today one, or a next future one. The template uses this WP_Query, that compares events date with the actual date: $args = array( '...
0
votes
1answer
74 views

Filter on the day of the week from timestamp

I'm trying to filter the display of posts by the day of the week (1=Mon, 2=Tues, etc) in the admin edit area. The custom field 'some-date' is a timestamp. The code below is not the right approach to ...
0
votes
1answer
78 views

Get Author Count By Day, Week and Month

I have a standard loop and I want to by the author's name show how many posts were published for the current day by an author.
1
vote
1answer
94 views

Replace ‘published on date’ with ‘modified on date’ on Posts

Okay, so I have googled this for the past few hours and even though I am getting closer, I am still stuck. Problem: If I posted an article on December 15th 2016 but I NOW I updated the same article ...
1
vote
1answer
430 views

Header: Include Date Published and Date Modified

I'm trying to put the Date Published and Date Modified into the meta tags of the head of the header.php page - so far no luck. This is what I currently have: <meta name="date" content="<?php ...
2
votes
2answers
573 views

Display date only once for a each set of posts relating to that date

The following loop works great for me in getting posts with a given date with the use of the_time(...): <?php $myPost = new WP_Query( array( 'posts_per_page' => '50', 'orderby' =>...
0
votes
1answer
72 views

Using system date format

I have WordPress theme and I use get_the_date function to display post data : <?php echo get_the_date( 'M-d-y' ); ?> But it seems it will be better to use get_option( 'date_format' ). How can ...
0
votes
1answer
54 views

Comparing Dates within plugin using PHP If statement

This is really simple, but I can't seem to make it work. I want the Due Date text to be red if the current date is past due. I want it to be green if it is still not due yet. Also, I set the due date ...