Questions tagged [date]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 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
7 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
19 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
27 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
25 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
17 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
26 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
35 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
11 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
63 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
17 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
61 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
18 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
18 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
18 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
16 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
41 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
48 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
49 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
27 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
46 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
40 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
23 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
37 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
12 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
50 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
37 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
35 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 ...
0
votes
1answer
9 views

Get posts from year from URL

I've created a page that shows content from a specific year. The year will be defined in the url. Example url: https://mpdb.space/stats/tour/?year=2019 It works perfectly when I type year=2019 but ...
0
votes
0answers
32 views

can not get query to display post count by month of current custom taxonomy in custom taxonomy page

I am trying to display post count by month of current custom taxonomy in custom taxonomy page. but it display total count by month <?php $post_type = "sikayet"; $posts = get_queried_object()->...
1
vote
1answer
50 views

Update all comments time to random dates?

I found this code snippet which randomly changes all the dates for all posts. (Original Post : Update existing post dates to random dates ) <?php /** * Plugin Name: WPSE 259750 Random Dates * ...
1
vote
1answer
65 views

Some Custom Taxonomy modified dates return false

I have a custom taxonomy and when I call get_the_modified_date($term_id), some of the taxonomy terms return the date but others return false. Even if I go in and manually modify these taxonomies in ...
0
votes
0answers
45 views

get_queried_object not work in taxonomy page

I am trying to display post count by month of current custom taxonomy in custom taxonomy page. but it display total count by month <?php $post_type = "tesekkur"; $posts = get_queried_object()->...
0
votes
0answers
24 views

How would I go about removing the date from a WP Date Picker?

I am using WordPress Pods (which extends Custom Post Types & Taxonomy). What I am trying to do is remove the year so it reads: November 30th I guess I'd do this by running a function through ...
0
votes
1answer
35 views

I am trying to get cutom post cout by month of current taxonmy term

Hi please help me how can i display custom post count by month like this at current taxonomy page. **i have been trying to solve this problem aready 2 weeks. ** December 0 January 0 February 0 ...
1
vote
0answers
17 views

Post count by month of taxonmy term

Can anyone help me please. i want to show custom post type count by month of taxonomy in archive page for current year. Example: January 24 February 43 March 5 April 6 and etc
0
votes
1answer
51 views

Use esc_attr() to print month name in French

I am working on a PHP code in which I want to display month name in French. <?php if (false !== strpos($translated_tz['diff'], '-')) { $ts = date_sub($altered_timestamp, ...
1
vote
0answers
156 views

Display post count by month of current taxonomy in archive page

Can anyone help me please. i want to show custom post type count by month of taxonomy in archive page for current year. Example: January 24 February 43 March 5 April 6 and etc. This code is help ful ...
2
votes
0answers
47 views

get_queried_object error How to show post count by month in the taxonomy page

Can anyone help me please. i want to show custom post type count by month of taxonomy in archive page for current year. Example: January 24 February 43 March 5 April 6 and etc. This code is help ful ...
0
votes
0answers
85 views

How to make a custom search form with date range? (Using Timber)

I have to create a data range search for my site with two input (start-date, end-date). I'm using Timber and i have no idea how to do it. Here's my code in search controller. How can I implement this ...
0
votes
1answer
89 views

WordPress add_filter to post_date

I using a plugin that it makes posts and etc date to Persian Date but the problem is I just want to convert date in front not admin panel or etc. I found that part make this action: add_filter('...
1
vote
2answers
99 views

How to translate functions like get_the_date()?

My wordpress website has two languages. The theme translates properly, but whenever I use get_the_date it is in the default english language. How do I force the use of another language? The locale ...
0
votes
1answer
21 views

Can't convert ACF datepicker value to DateTime oject - gives me a boolean

I keep getting this error Call to a member function modify() on boolean with this code $date_value = the_sub_field( 'date_string' ); $date = DateTime::createFromFormat('d/m/Y', $date_value); $date-&...
0
votes
0answers
14 views

Date object in the query to show posts from the following month

I'm building a booking for events, each event is divided into taxonomies, this is the query that regulates my custom post type, to display all the posts that are under the "aperitivi" taxonomy. $...
0
votes
1answer
17 views

Changing Date Format on Custom Meta Data w/shortcode call

I am currently pulling a date from a users meta and making it so I can input a shortcode and it will show that date in certain places. I have the following code written and it works great! function ...
0
votes
1answer
29 views

Count time from registration date to today

I would like to add to the user profile the time from registration to the current day in the format: With us: 7 years 3 months 2 weeks 6 days OR With us: 1 year 1 month 1 week 1 day Me a bit ...
0
votes
0answers
22 views

Multiple orderby date arguments

I've had good luck with using multiple orderby arguments in the past, but now that I'm trying it with dates I'm wondering if there's something I'm missing. I'm trying to order some posts by an ACF ...

1
2 3 4 5
10