Questions tagged [date]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
8 views

Not work hide comments with future date

My code not work function filter_where( $where = '') { $where .= " AND wp_comments.comment_date < '" . date('Y-m-d H:i:s') . "'"; } add_filter( 'pre_get_comments', '...
0
votes
0answers
17 views

Data is lost after ajax call on Second filter (by date)

I have two filters. First one is the filter by post category, it works well. The second category filter is post by date (period = week, 2nd week) and work only on first click for this filter. Edit: I ...
0
votes
0answers
12 views

Translate Post date (month) of china language

How can I translate with the date output format like this: AUG 2020 with php wp or my wordpress site is currently using the polylang plugin. Please help me, thank you.
-1
votes
0answers
12 views

Random date for all comments in the range of 2 days

Tell me, please, is it possible to somehow update the date of all comments? I need to update them every day, i.e. it is necessary for each comment to change the date to a random one in the range of ...
0
votes
1answer
25 views

How to apply CSS based on publishing date

Is there an idea in WordPress that can apply CSS file only to posts published after a certain date? Renewal a site created with WordPress. It is to keep the previous record and apply the design ...
0
votes
0answers
18 views

I change post date, but it updates only after refreshing the page

Here's my snippet: function prideti_mygtuka($post){ echo'<div class="igno-button">'; echo '<form method="GET">'; echo '<input type="hidden" ...
0
votes
1answer
14 views

Local Post Date in Wordpress Admin Panel Tables

It seems that Wordpress does not save the post date in UnixTimeStamp in the database, and it comes up with the whole date and time format, as we can see in the image below. With this introduction in ...
1
vote
0answers
9 views

Events are all showing the current date

I have installed lately the ACF plugin by Elliot Condon to manage my posted events on my website, I've put inside the WP_Query array the following: <?php $today = date('Y-m-d'); $homepageEvents = ...
0
votes
0answers
17 views

Display posts between two dates meta_query wordpress

I have two custom fields (advanced custom fields) of "start_date" and "end_date", I want to filter the projects that are between the two given dates, here is what i've tried: ...
0
votes
1answer
15 views

How can I tranlslate post date in italian?

I'm using this filter to display post date in my single and archive pages, because working on a windows azure php app I can't show post date before 1901. This filter is working but It displays post ...
0
votes
1answer
34 views

Display date and time into post edit comments section

My users need to see the date and time for each comment from the post edit page. Can anyone help me to display these metadata please? Edit: When editing a post (cpt in my case) you can see the ...
1
vote
1answer
13 views

Ordering posts by publish date not working?

My site has a "Portfolio" page, which pulls in posts in category 3. Here is my code which selects the posts: <?php $args = array('cat' => 3, 'post_type' => 'post', ...
0
votes
0answers
9 views

Display future post date as X days, Y hours, Z minutes to go

I have a plugin that can display future posts And I have a function that converts all dates to human_time_diff // Relative date & time function wpse_relative_date() { return human_time_diff( ...
0
votes
1answer
45 views

Archive filtering posts by year and month

I want to create a date archive were all the existing years containing posts are appearing in a list, together with another list containing the 12 months of the year. Essentially it would be like this:...
0
votes
2answers
46 views

Get users based on month ACF datepicker field

I have an ACF field 'date_of_birth' which stores the user's birthday, examples: 20201226, 20151225, 19980701 Goal: get all users which have their birthday this month, or next month. I currently have ...
0
votes
0answers
11 views

Display how many custom posts published in every month, current year and current custom taxonomy

i want to Display how many custom posts published in every month, current year and current custom taxonomy. Example january (20) febrary ( 10) march (33) and etc my code problem is that it ...
0
votes
1answer
28 views

Ordering posts by anniversary using only day and month

I defined a custom field named crimedate using standard date format Y-m-d. I defined the filters to make ordering by this date work in the post list of the backend, which works fine. Now I need the ...
0
votes
1answer
71 views

Ordering posts by custom field named “date” in backend

I defined a custom field named "date" and now want to order the post list in the backend by this field. I defined the filters to make ordering work and header is clickable and shows the ...
1
vote
0answers
17 views

How do display most popular post from a year earlier to the day?

I'm trying to display a post that was the most popular a year ago on the day it was posted. So today would be October 12, 2019. I would like to base it off of this: functions.php: function ...
0
votes
0answers
174 views

How to filter product by date range in wordpress WooCommerce product archive page

I have a WordPress food site through Woocommerce. The store page is a weekly menu, and I want to show on the store page only the menu for this week. A new list is entered every week. I found the ...
1
vote
1answer
12 views

wordpress convert timestamp to date not correctly

I use wp_date() function to convert and show dates with hours and minutes. wp_date( 'Y/m/d - H:m:s',1598205923, 'Asia/Tehran' ) My problem is it shows Y/m/d correct. the hour is ok. but it shows m:s ...
0
votes
0answers
30 views

Wordpress wrong dates bug

I am using Wordpress version 5.4. I have a problem with the dates in a CPT, and it is that the dates show one day less. Example: If I put in the backend the date, 08/18/20, in the frontend it shows me ...
0
votes
0answers
35 views

ACF Repeater dates => slow query

For events module, I'm using ACFPro with repeater fields. Everything work well except the query takes 21seconds. As you'll notice, the end_date has to be > than today or empty. (I thinks this it ...
0
votes
1answer
46 views

I want to format my Post dates differently to other dates on my website

My Posts dates have the form specified in the WP General settings (d-m-Y), But I want to keep those settings and change the format for Posts only (F Y). How do I do that? Thanks for your efforts. I am ...
1
vote
0answers
22 views

Updating Media Published Date When Parent Post Is Modified in Wordpress

I am hoping to make the published date of my media files always equal the modified date of the post it's attached to. e.g. Image 1 (date: 1/1/20 5:00PM) is attached to Post 1 (date: 1/1/20 5:00PM) ...
0
votes
0answers
28 views

Sort by date Function ? post date randomizer wordpress

function pdr_randomize() { $randomize = isset( $_REQUEST['randomize'] ) ? $_REQUEST['randomize'] : ''; if ( isset( $_GET['pdr_rd_nonce'] ) && wp_verify_nonce( $_GET['pdr_rd_nonce'], '...
0
votes
0answers
50 views

Delete product after time period

i have problem, i can’t do function with delete product after time period. I was found this: https://wisdmlabs.com/blog/delete-products-woocommerce-shop-specific-time-period/ but dont work in my site, ...
0
votes
0answers
25 views

Woocommerce: Adding Date(s) to products and show date in Product Sorting dropdown

We are selling hiking tours with Woocommerce and i would like to add a custom date to a product. Since one and the same tour happen 3 times per season i would like to give a customer a possibility to ...
0
votes
1answer
135 views

Removing old_slug and old_date from WordPress Database

I am trying to clean my database. In the wp_postmeta table I see thousands of _wp_old_slug rows. I am not concerned about these old links not being redirected. What are the pros and cons of removing ...
0
votes
2answers
30 views

Are there any know limitations on the date field, especially how old dates can be?

Our site needs a way to order a large number of posts (think +6000). After looking at some plugins I have decided to just use the date field since it is built into wordpress. It's kind of silly, but ...
0
votes
0answers
36 views

Error after filter on date

When i try make filter on date via calendar picker, i have error: Fatal error: Uncaught Error: Call to a member function format() and in highlights i see this line code: $m2 = $dateObj->format('F');...
0
votes
1answer
26 views

Image title replace with current date

Currently, when uploading an image, Wordpress automatically uses the image name as image title. Is there a way to automatically use current date for the image title?
0
votes
1answer
244 views

Change pubDate in rss feed in another format

In the default wordpress rss feed the element <pubDate> is <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate> ...
0
votes
1answer
28 views

Don't update modified post date when user add a product review or comment?

I am using WooCommerce and I added the following code on content-single-product.phptemplate to show last update of product: <p class="data-label">Updated</p> <p class="info"> <?...
0
votes
0answers
21 views

WP_Query() displaying past post / event

I'm making a page for past events (using Event Expresso plugin) and I'm kinda confused about the wp_query. This one works: $atts = array( 'title' => NULL, 'limit' => 100, '...
0
votes
0answers
20 views

Redirect page during a weekly time interval

I have a registration page 'register' which sends information to a third party server as part of a dual registration process. The 3rd party have a 2 hr weekly maintenance schedule every Friday 9-11pm ...
0
votes
1answer
17 views

How to display posts categori list by day wordpres

Please help me I want to make a list based on the name of the day ordered based on the selected category I have code like this but it doesn't work orderby day <?php $args = array( '...
1
vote
0answers
46 views

WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC

I'm trying to set up a query for an "event" custom post type that groups posts by year, with a heading for each year, in descending order; then, for each year group, ordered by date in ascending order ...
1
vote
1answer
63 views

What are the “U” and “G” time formats?

In WordPress time functions, such as get_post_time(), one can pass a couple of formats that I do not understand what they do. Those are U and G. What are those exactly? Documentation is pretty vague. ...
0
votes
1answer
62 views

Remove the month and year from a WordPress Date?

So, I am wondering if there is a way that I can make this: February 28th, 2020 Just output NO month and NO year so just 28th (i.e. just the date) What approach would you take? I am applying this ...
0
votes
0answers
30 views

Display Category Name and Date Posted on Blog Post

I am using Astra Theme wordpress >5.0 version I want To Display Category name at top left corner of my Blog post Like Category:Technology.Also Date Published above header like Date Published:3rd ...
0
votes
2answers
89 views

get_the_date() returns english Year & Day when language is Arabic

I changed my WordPress language to Arabic, Now get_the_date() returns يناير 30, 2020 (half Arabic & half english) but I need to get date full Arabic like: يناير ٣٠, ٢٠٢٠ How can I do this?
0
votes
1answer
70 views

WordPress suddenly starts uploading media to an old (backdated) folder

I've seen a couple of people ask about this but without a general conclusion. It worked until recently, but recently all media uploads from the media upload tool end up in an old folder, 2019/10, ...
0
votes
1answer
16 views

Comparing Meta Field date in WPQuery using Meta_Query?

I have dates stored in the format d-m-Y, and i want to display any posts that are in the past, before today. $args = array ( 'post_type'=>'property', 'post_status'=>'publish'...
0
votes
1answer
25 views

Sort custom post type by most current date picker

I'm trying to sort custom post type made with ACF plugin by most current date. Ideally future most current post should be first. Currently, I'm sorting by date, which gives me the earliest post as the ...
0
votes
1answer
39 views

How display modified date of most recent modified post in wordpress?

I need display last modified date of most recent modified post in out of loop.
0
votes
0answers
16 views

Serve visitor post time adjusted to their timezone

I want post times to reflect the timezone of the logged in or logged out user on my site. So if I post at 2:43PM London time, I want a user or visitor from Tokyo to see the post time as 11:43PM I'm ...
0
votes
0answers
81 views

Compare ACF Date field to today or yesterday

This is a very simple question, but for some reason having challenges with it. I have set up ACF field group. I wanted to compare a "date field" to the current "today's date" and "yesterdays" date. ...
0
votes
1answer
64 views

How can get the last post date of the user?

I want to get the last post date was written by the user and here's the code that I have made but it's not working: function get_user_last_post_date( $user_id ) { $args = array( '...
0
votes
1answer
38 views

Possible to edit custom date field and display?

I would like my site to show the x time ago on posts but we also have lots of events listed that are effected by the sitewide change and are also showing x time ago dates too even if they are in the ...

1
2 3 4 5
11