Questions tagged [date]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
34 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
11 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
23 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
23 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
26 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
28 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
19 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
14 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
32 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
17 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
29 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

Month list with post count for current taxonomy term [closed]

please help me to create Month list with post count for current taxonomy term. Can anyone help me please. i want to show custom post type count by month of taxonomy in archive page for current year. ...
1
vote
0answers
16 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
19 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
28 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
40 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
34 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
28 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
30 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
11 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
13 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
16 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
15 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
20 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 ...
0
votes
0answers
24 views

Sort posts numerically by converted date format

Updated for clarity: I need to convert the post date format from Y-m-d to mdY and sort by mdY numerically, not by the actual timestamp. My goal is to order the posts by month first, then day, then ...
0
votes
2answers
24 views

How to get only present and past posts with post_date

An administrator wants to make posts for a future date but not visible for visitors. The posts come from a custom WP_Query inside my plugin so the basical WP behaviour does not work in this case. I ...
1
vote
1answer
37 views

Wordpress post dating - pre 1901?

I've created a wordpress blog locally hosted on a Raspberry Pi 4 4GB using a 500GB USB SSD. It works beautifully as an evernote replacement. I do have a problem with dating the posts however. I want ...
1
vote
1answer
60 views

How to break a date from ACF?

I need to print the number in one font, and the year in another <?php $timestamp = get_field('date_time'); ?> How to do it . help me please
0
votes
0answers
21 views

Last Update Date/Publish Date for Specific Categories

Is there a way to show the published date on one of my post categories and the last updated date on all the other categories? I've got a site with game reviews and would love these to display the ...
1
vote
1answer
59 views

Get Date of custom field and use conditional logic

I'm relatively new to Wordpress development and I'm trying to learn more about custom coding. For starters, I would like to know how to retrieve the date of a custom field and use conditional logic ...
0
votes
1answer
14 views

What date to use as a post date? date_gmt or modified_date_gmt

I am consuming a rest service with the posts, and get both date_gmt and modified_date_gmt ... What realy is the difference ? Is the modified_date a publish date also? Any way, if I am presenting ...
0
votes
1answer
35 views

How to add published date in product [closed]

I have on my site some products. My plan is to show some deals. But I want to show also the published date of the deal, the date that i have published the deal. Like a blogpost shows the published ...
0
votes
0answers
23 views

WP Query for all events prior to current date

I'm trying to display past and future events using a wordpress query. I'm able to query future events and even events that are on the same date as the current date. But, when i use less than or ...
0
votes
0answers
19 views

Need to display a Jan 1st post as the site's front page on Jan 1st, and Jan 2nd post as front page on Jan 2nd etc

slightly unusual client request. I'm using Divi and I have a nice Divi layout created for a video and text post which is ready to go. The client wants to create 365 posts (one for each day of the year ...
0
votes
0answers
54 views

How to add “er” after particular days of the month in php?

I am working on a html/php code as shown below: <?php if(ICL_LANGUAGE_CODE=='fr'){ ?> /* When the page is in French */ <time datetime="<?php echo esc_attr(date_format($ts, 'H:i d-m-Y'...
0
votes
0answers
24 views

date_i18n in wordpress/php

I am working on a html/php code as shown below: HTML/PHP Code: <time datetime="<?php echo esc_attr(date_format($ts, 'H:i d-m-Y')) ?>" data-timezone="<?php echo esc_attr($tz_param) ?&...
0
votes
0answers
14 views

Custom shortcode sorted by meta date shows only current year and displays other language in date

I have this snippet in my functions.php. I thought it worked, but I noticed that it shows events only from this year (I have more events that are next year) and also, I can't get the date format to ...
1
vote
1answer
86 views

display month in french in wordpress/php?

I am working on a php code as shown below: <?php <time datetime="<?php echo esc_attr(date_format($ts, 'H:i d-m-Y')) ?>" data-timezone="<?php echo esc_attr($tz_param) ?>"><?...
0
votes
0answers
36 views

WordPress Admin - Automatically Sort Custom Posts by Custom Field Date Value in d-m-Y Fomat

I have a custom post type called 'Courses'. I'm currently trying to automatically display them in the dashboard 'Courses' post list sorted by a date value specified in a custom field. The date value ...
0
votes
0answers
105 views

Comparing two dates (ACF and current time)

I’m trying to compare two dates (the current date with an ACF datepicker one) to display specific content. What I’m trying to achieve is to display a phrase if the ACF date is lower than the current ...
0
votes
1answer
29 views

Update existing post times to random times?

I have found a code here that will randomize the date of all posts to a random date. Here is the code that someone has posted: <?php /** * Plugin Name: WPSE 259750 Random Dates * Description: On ...
0
votes
1answer
22 views

Update post meta date always store 1970-01-07

I want to update the post meta "job_expires" to the current "job_expires" meta data + 1 week but with this code always store 1970-01-07 as date. $lejar_datum = get_post_meta($job_id , '_job_expires', ...
0
votes
0answers
50 views

Display post date with the date archive link for custom post types

i have a custom post type and every single post it displays post date like 05 Jun 2019. i show this date with this code : <a href="<?php echo get_day_link(get_post_time('Y'), get_post_time('m'),...
0
votes
1answer
24 views

Display time difference (6 hours ago) in a Soliloquy caption

Thanks for viewing. I am using a soliloquy plugin addon to display post date in slide captions. I want to change the post date to human difference or 'hours ago' format. I'm converting get_the_date ...
0
votes
1answer
303 views

How to display upcoming events by dat with Modern Events Calendar Lite

I'm using the plugin Modern Events Calendar Lite. This is a recent plugin, so actually no doc exist. So i'm looking a way to display my upcoming events on homepage. But i can not make it to work, ...
0
votes
1answer
52 views

Set a post expiration and delete a post when expirate

I'm trying to create a function that allows me to delete an article when the date of the day is equal or superior than a date filled in a custom ACF field. I wrote the function below that I placed in ...
0
votes
1answer
64 views

Filtering posts by archive showing all years

I have set up a WP_Query within my archive.php page. This is so I can do different things such as pagination etc. I also have two drop down filters categories and archive (yearly). When selecting a ...
0
votes
2answers
28 views

How to add publish date in the title

I learned a solution from https://stackoverflow.com/questions/36671203/wordpress-publish-date-shortcode Although it can show the publish in the title, in the source code, it still shows the shortcode ...
1
vote
0answers
22 views

Meta query: How do I return posts within a date period from a given month?

I have posts with a meta start_date and a meta end_date, stored in timestamp format (I can change the format if necessary) I would like to return all posts that have a date in that month by giving a ...