The tag has no usage guidance.

learn more… | top users | synonyms

-1
votes
1answer
93 views

get_the_date() return always UTC+0 [duplicate]

I need to return correct ISO 8601 date format for my country (Poland, Warsaw). It should be UTC+1. I use function get_the_date() with argument "c". On General Settings in field Timezone I chosen "...
0
votes
1answer
49 views

Display year value before a set of posts

This is what I am trying to accomplish: I have a page template which displays "case studies" where "case studies" is a custom post type. the page template called: page-case-studies.php I actually ...
0
votes
0answers
98 views

Automatically move pending posts after 30 days and, update the post date, when users update the posts

I have a multi-user blog, and would like to implement two functions in WordPress 4.3.1. The first function moves publish posts in pending after 30 days. I used a add_action. My code: function ...
0
votes
1answer
1k views

Order by custom field date?

I've created a category "Expire Soon" and i want to insert and sort the posts by custom field "expiration_date". I use this code but the posts are sorted by custom field "expiration_date" but not by ...
-2
votes
4answers
41 views

How to remove a date from wordpress post

djeddiedavid.info this is my website i want to remove a date that show on wordpress posts anyone help me ? date that show on the bottom of DJ upcoming event
0
votes
1answer
46 views

Get previous posts list

I'll give up. Have searched and searched and tried and tried... Can't find any solution to list previous posts. On a single post: I want to show a list of the 10 previous posts, the 10 before the ...
0
votes
1answer
82 views

Month display in English but required in Swedish?

I am using WordPress settings like below Image: On post output come like 13 October 11:49 but my requirement is to make it like oktober in Swedish and same for all other months. Thanks!
0
votes
2answers
41 views

How can I query on the year part of a complete date in a custom field?

My posts have a custom field named production_date and formatted YYYYMMDD. How can I form a meta_query to select only the YYYY part? $meta_query_args = array( array( 'key' => '...
0
votes
1answer
358 views

Retrieve taxonomy terms in order of their post's date?

I'm building out a custom taxonomy archive page that needs to list terms in order by their associated post's post_date. I wrote this, it's working, but I hate resorting to custom SQL: global $wpdb; $...
5
votes
2answers
1k views

How can I query all users who registered today?

I'm trying to use meta_query to return all users that have registered today : $args = array( 'meta_query' => array( array( 'key' => 'user_registered', 'value'...
0
votes
1answer
58 views

How to restrict an author scheduling their post date to a maximum X days ahead from the current date

How would I restrict an author in scheduling their post X (let's say 8) days ahead of the current date?
2
votes
2answers
2k views

WP_Query() show posts that end later than today

I have a query as follows: $wp_query = new WP_Query( 'meta_key' => 'end_date', 'meta_value' => 'today', 'meta_compare' => '>=', 'post_type' => 'vehicle' ); ...
0
votes
1answer
41 views

suffix title with “EXPIRED” when scheduled post has reached it's published date

I'm scheduling and displaying all my posts in the future. I'd like to somehow add some text after the post title when the publish date is reached. In effect the post will expire at the time of the ...
0
votes
1answer
30 views

empty query breaks other queries

Hi I have a cpt query which displays 1 latest event based on date. It works fine - problem is when date is < today (theres no future events to display) this query is empty and also breaks other ...
0
votes
0answers
44 views

Use the_date with link

How I use the_date with link, a link to archive same date. <?php the_date('l j F Y', '', ''); ?> When there are multiple posts on a page published under the SAME DAY, the_date() only ...
0
votes
1answer
34 views

How can I set and update the the_date according to a custom field of the post

How can I set and update the the_date according to a custom field of the post? I have a custom field "date-time" with the following format yyyy-mm-dd hh:mm e.g. 2015-09-30 08:12 I'd like this date ...
0
votes
1answer
471 views

Ordering posts by custom field and grouped by month

I need display all custom posts (event), order them by custom field (date) and group by month: September Event 1 Event 2 August Event 3 July Event 4 Event 5 I know, it is frequently asked ...
0
votes
0answers
114 views

date archive future posts

Im using cpt for events and i need to display them in a calendar. most of the events are future. i managed to query the right ones by post_status at the archive, but I need to do the same at the ...
0
votes
0answers
152 views

How to get to the date of the uploaded file

Anyone can tell which is the filter (if there is any) used for the date of an uploaded file. This can be useful to limit the upload for the users based on the time.
0
votes
1answer
91 views

How to display a WordPress Custom Field only on a specific day of the week?

I've got WordPress site for which I've set up a custom post_type along with some custom fields created with CMB2 to display extra stuff within my custom posts. When editing a single item for my ...
2
votes
2answers
547 views

Date, Time, and Timezones

I am a bit confused about using dates/times along with timezones in WordPress. I have the following questions: What is the purpose of the timezone setting in the Admin -> Settings section? Assume ...
0
votes
2answers
137 views

Query post for today, if no post get the previous one

EDIT : I answered myself. Simple request for you. I am trying to develop a code that search for post for TODAY. If it returns nothing, then get the latest post before today. For now, I have made a ...
0
votes
0answers
51 views

WP Group posts by year(desc) > month(desc) > date(asc)

I have a custom category template to group posts by a custom field 'event_date'. 2 things I cannot figure out, correctly: grouping by year and month, and having those in descending order, while the ...
2
votes
0answers
2k views

query_posts with a custom post type, a meta_query and sorting by post date?

I've searched the archives and found questions similar to what I need, but haven't found exactly what I want. I've got a bunch of products that are sorted by a meta_key of country, and I'd like to be ...
0
votes
0answers
58 views

correct date for each post / photo

I need help. I published three post photos on different days with different dates. Why the dates are not in sequence but inserted according to when they were published ..!? I wish that if something ...
1
vote
2answers
74 views

Get date numerical and separate?

I need to work with date function but I want to get day and month numerical and separate and pass it to a function. For example, I want work for this function. function(day,month) How can I ...
0
votes
0answers
632 views

Get month and day from a Date Picker custom field

I've got a custom field called fecha_del_evento from which I want to obtain the day and the month in different formats; day in numbers, and month with the 3 first letters. The code I'm using is a ...
0
votes
1answer
119 views

Loop posts in a table ordered by a custom field value

I'm trying to generate a table for a custom post type events, in which I have a few custom fields, one of these is the date. I want to display the posts in the table and order them by the Date value. ...
0
votes
0answers
25 views

Post Query Glitch Causing First Post to be Out of Order

My problem is that there is a stubborn post at the top of the set of returned posts that somehow isn't sorted with the rest of them. Despite upgrading to 3.9, this issue still persists. For instance,...
0
votes
0answers
22 views

Set post beginning date and final date

I'm developing a website that is like a Advertisements System. I tried to use Post Expirator but it doesn't work the way we need. It must set a BEGINNING DATE and EXPIRATE DATE. Because will be A ...
-1
votes
2answers
975 views

How to show monthly archive posts?

my custom archives page is : <?php get_header(); print ('<div class="row">'); $archi = wp_get_archives('echo=0'); $archi = explode( '</li>' , $archi ); $archi_count = ...
0
votes
0answers
93 views

JQuery Datepicker Blackout Dates

add_action('frm_date_field_js', 'limit_my_date_field'); function limit_my_date_field($field_id){ if($field_id == 'field_jk8k8s'){ //change jk8k8s to the key of your date field //get all the ...
0
votes
0answers
99 views

Change permalink , keeping old structure with date

Currently on our website we have the /date/postname permalink structure with quite a number of posts. For SEO purposes we want to change it to /postname permalink structure but we want to keep the ...
1
vote
1answer
453 views

Date query for a custom meta field

I would like to use something similar to the following date_query but I would like to use some custom meta fields instead of the existing post columns. For example instead of post_date_gmt I would ...
2
votes
3answers
5k views

Display posts of the last 7 days

I'm trying to display the 5 best rated posts of the last week (7 days) on my website, however I can't seem to figure out how to display them. Here's what I've achieved so far but it doesn't seem to ...
0
votes
1answer
79 views

date() returns incorrect value if used from WordPress theme, but correct otherwise

As I have mentioned in title if I use date('H') function in WP theme, it simply returns UTC time, but the server is set to use timezone Europe/Riga and the same is set in WP General settings. At the ...
1
vote
1answer
673 views

Bulk edit post date in wordpress

I need to edit the date of several posts, change it to a specific date, all posts should have the same date. How can I achieve this? Is there any fuction to add to the functions.php to add this ...
2
votes
2answers
32k views

How to get date for each post?

while (have_posts()) : the_post(); //some html <li class="icon-date"><?php the_date('Y-m-d');?></li> <li class="icon-time"><?php the_date('H:i:s');?></li> With ...
0
votes
2answers
134 views

Skip posts, but keep posts per page

I'm running through a normal loop on one of my templates, and it displays a list of upcoming events with dates. I'd like the events that have passed to stay active, but not appear in my list of posts. ...
0
votes
1answer
2k views

Group posts by date with a list

I want to set a group of posts grouped by date as a list. Below is what I would like to have: Day... <ul> <li><a href="#">Lorem ipsum</a></li> </ul> Previous ...
1
vote
1answer
74 views

Get the next event using date_query

I created a CPT called event and want to make a query to show the next future event, based on it's publish date. Here is the WP_Query args: $today = getdate(); $args = array( 'post_status' => ...
0
votes
1answer
171 views

How to filter posts in admin by before date or by post status 'future'?

I have read/searched a ton of questions but all I find seem to be related to custom post types and such. The situation is that sometimes we happen to have a lot of posts waiting for to be published ...
0
votes
1answer
623 views

Getting images from media library and get_the_date() not working

I've got a function to display all images in the media library on a page. I would like to display the date of each image, but using get_the_date() only returns today's date. Here is the code I'm ...
0
votes
1answer
314 views

group posts by month/date ignore years

Need group posts from custom post type by post date. Example: Jan (all posts posted in januar for all years 2010,2011 ... 2015) 1 (all posts posted in 1 januar for all years 2010,2011 ... 2015) POST1 ...
0
votes
1answer
70 views

How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]

I am modifying someone's Wordpress theme and they have a section for upcoming tour dates. The page for inputting was made with Advanced Custom fields plugin and uses a date picker widget that stores ...
1
vote
1answer
178 views

Complex WP_Query order request: DESC by day, but then ASC by time

I've got a site with a couple thousand time-stamped posts in a custom post type. These get displayed by a few taxonomies and a date query in various views (I've got that all working just fine already)....
0
votes
2answers
2k views

Convert WordPress date format to jQuery UI Datepicker format

I wrote the following function to convert the current WordPress date format into a format that can be recognized by the jQuery UI Datepicker: From: http://codex.wordpress.org/Formatting_Date_and_Time ...
1
vote
2answers
132 views

Change date from 2015/02/23 to “1 min ago”

So here is my code to display the post created date: $date_create = '<div class="mydate-created">'; $date_create .= get_the_date('',$product->id); $date_create .='</div>'; ...
0
votes
1answer
71 views

Limit loop to future events

I have a custom post type, basic_events, with a custom date field, date_of_event. My view shows these posts in ascending order, based on this custom date field. $args = array( 'post_type' =>...
0
votes
1answer
468 views

How to show list of posts with custom field value (a date) that are coming soon

I have a custom post type called client and it has a custom field of next_due_date, that is a date without time. I want to have a list of posts that have a next due date that is coming up soon. I ...