The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
87 views

Redirect to URL if x number of days passed

Let's say I have this URL: www.example.com/myCPT/post, here I want to check if 3 days has passed since the post was created to redirect to www.example.com/myCPT/post/stats. In this 3 days time frame ...
0
votes
1answer
159 views

Sorting meta box values by start- and enddate and all dates in between

What I've been attempting to write is a function that will allow me to sort a list of WordPress posts by their meta values start date, end date and all dates in between. I've set up a custom metabox ...
0
votes
1answer
432 views

Time sort with meta_key using UNIX timestamp failing due to date differences

I'm dealing with the following issue trying to sort a custom post type by a meta key created using the Advanced Custom Fields plugin Date and Time Picker add-on. The add-on creates a jQuery datepicker ...
0
votes
1answer
95 views

Should I escape the attributes when using get_month_link?

I am not sure should I use esc_attr() with get_month_link() like this: <a href="<?php echo esc_attr( get_month_link( get_the_time('Y'), get_the_time('m') ) ); ?>"> <?php the_time( ...
2
votes
1answer
256 views

Display post links under month in paginated archive

I'd like to create an archive that lists posts under a month header. The months would just be plain text and the post titles, obviously, would link to the posts themselves! So: October 2013 Post ...
0
votes
0answers
46 views

publish posts immediately when updating

i'm looking for a way (maybe a plugin) to have a choice of just updating an already published post, and updating and republishing it with a current date and time basically, two options when editing: ...
0
votes
1answer
323 views

Compare WP Custom Field date

I had create a custom field "date" with this format 16/09/2013 (d/m/Y). How can i compare date and show only post with date from today ? This is my query that don't work !! $args = array( ...
-1
votes
1answer
230 views

get posts based on category and post meta

I am coding a Live Show box for a radio website to show who is on air and who is up next. I've been using the get_post function to retrieve posts based on the category (in this case the day of the ...
0
votes
0answers
18 views

Change core metaboxes labels [duplicate]

I am creating the oh-so-common Events custom post type and I want to use the published date as my event date. Eventually, in my archive, I will make sure to display posts with the scheduled status. I ...
12
votes
2answers
458 views

Unable to select an old date in wordpress

I am unable to set the year below 1899 for a post. If i set year below 1899 it is set to the current year automatically. I have purchased the Timeline theme and asked in their support forum. They ...
2
votes
2answers
315 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
1answer
46 views

Access last visit time to a post

Is there any function or a way to access the time of last visit to a post by a visitor?
0
votes
1answer
174 views

How do I convert all custom_field php timestamps in the database to js timestamps?

For the past year, we've been storing date-time values into a custom field _date using strtotime(). There are about 100 PHP date-time stamps in our database from over the past year. I would really ...
1
vote
0answers
345 views

date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)

I got used working with the More Fields plugin. But it seems that fields like datepicker timepicker date/timepicker image upload (media library) are missing somehow. Is there a plugin which can do ...
1
vote
1answer
306 views

If modified on same day, show only time

I have a date on each post and comment which shows the date of placement. If I edit it, it shows me the date of the post and the modified date. That's fine, but now, I want to show only the post date ...
0
votes
3answers
1k views

Problems with the_time,the_date, get_the_time

I have som problems with the date functions in wordpress. I am trying to get different format on the post date on some pages and i have been trying "the_date()","the_time()" and "echo ...
0
votes
2answers
286 views

comment_date() & comment_time() not working from functions.php

I use the following function to get the latest comment for each one of my posts and display it on archive and index pages under the post content: function kv_latest_comment($post){ $args = ...
0
votes
2answers
217 views

Copyright: Get first and last date of post type

I was searching for the easiest/fastest way to get the accurate date range for copyright notices in the footer. The copyright notice shouldn't only contain the year, but as well take month and day ...
0
votes
2answers
216 views

How to add correct Last update in Postings (the_modified_time)

Having little issue with following: We want to add "Last update" after making important corrections or additional text/images to existing Postings. Using following code (hardcoded) does in a way ...
0
votes
1answer
568 views

setlocale for date

So I purchased a premium wordpress theme, but I can't get through its Polish localization - the dates outside the_time or the_date are displaying in English (default server's language). I read that I ...
2
votes
2answers
134 views

Unable to set right time in admin and frontend template

When I run a simple php file called test.php (placed in the root of the wp installation) that contains something like that: <?php echo date('H:i:s'); ?> The result is right: 15:30:00 and the ...
-3
votes
2answers
305 views

Datetime on time tag wordpress puts it outside the tag

I want to use a time tag with the datetime attribute in it... I tried this in functions.php: <time class="time" datetime='. the_date('d-m-Y') . '>%3$s '.get_the_time( $d, $post ...
0
votes
1answer
65 views

Where does the time get pulled from in the_time()

I am currently using the following function in my footer <?php the_time( 'Y' ); ?> But the footer keeps showing 2011, instead of 2013. So where does this time stamp get called from exactly?
1
vote
1answer
54 views

“is_new_day()” alternative for years?

I don't believe there's a is_new_year() function in WordPress, as an alternative for is_new_day(). I'm trying to display the year only once for each set of posts, what would be the best way to do ...
2
votes
2answers
167 views

Echo Messages By Checking current_time()

Before asking for help I would like to clarify that I don't have advanced skills on PHP. What I want to achieve is to display different messages for every period of time that I set (I need this to ...
0
votes
1answer
321 views

admin end post published time display not working correctly

I have the inconsistency in post published time. For example, as I published a post on April 20nd 9pm and it is April 20nd 9:30, wordpress shows it is published one minute ago in the admin end. Also ...
0
votes
1answer
63 views

Format Date for Manual Insertion into post

I have the following $mydate = "26 January, 2012, 5:05 AM"; I want to format this date properly so I can insert it into a post_date. Is there a simple way to do it? $post_ information = array ( ...
2
votes
5answers
2k views

Get date of last update outside of loop

I'm trying to figure out how to display the date that a post was last updated outside of the loop. I'm able to display the published date using get_the_time() but there doesn't seem to be a "loopless" ...
6
votes
4answers
6k views

Converting timestamps to local time with date_l18n()

I've got a WordPress cron job that sends an email periodically and saves the timestamp when it was sent as an option, and I'd like to display a date on a settings page. Something like, "The last ...
3
votes
1answer
1k views

Formatting custom meta box date from YYYY/MM/DD to a more readable alternative

QUESTION This is following a previous question that was graciously answered by Milo earlier here - How to sort CPT by custom meta value (date), and return posts month by month In short, I'm having ...
1
vote
2answers
18k 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
1answer
3k views

Advanced Custom Fields and date picker, show posts only if the day is today no matter the year

I've created a site made just with custom fields about famous people in sport. In the post page I've a born date and a death date field using the data picker. What I'm trying to achieve is to show ...
1
vote
2answers
97 views

Changing “submitted on date” of comments

How do I change the "submitted on date" of a comment to an earlier date? I want to change the date that is displayed to the readers. As far as I know, I can change the date of the post by clicking the ...
4
votes
3answers
1k views

Running WP Cron on specific local time

The scenario is to run insert_post function every midnight (00:00) of local time. Must run daily on weekday. function add_daily_task(){ if((date('l', time()) != 'Saturday') || (date('l', time()) ...
0
votes
2answers
222 views

Can i show items based on the day with php?

I have a code on my site that displays different headers for different post types using the if ( get_post_type() == 'post type here' ) { code but is there a way i can do this for days of the week? ...
0
votes
1answer
549 views

datetime picker, timestamps and meta queries

I have a custom meta box with a datepicker. The datepicker outputs 2013-01-17 10:00 in my database for an event that is 01-17-2013 at 10pm PST. $eventlist = new WP_Query(array( 'post_type' => ...
0
votes
1answer
180 views

Order posts by month - in custom taxonomy template

I'm trying to show all posts posted under the month, so 2012 December post 1 post 2 November post 1 post 2 The posts are to appear under my custom taxonomy template, so taxonomy-pubyear.php and ...
1
vote
1answer
159 views

Displaying custom field according to date

I am not sure whether this is an Advanced Custom Fields-related question, or a general PHP question, so I have also posted this to the ACF support forum, for those of you who are also looking for ...
3
votes
1answer
1k views

How to List Events by Year and Month Using Advanced Custom Fields?

I have a custom post type "Kalender_item" with a custom Date Field (YYMMDD). I want to list all the posts on a page sorted by Year and Month. For example: November 2012 (all events that occure ...
1
vote
1answer
143 views

Show 1 post and after a specific date show the next one

I used the following query to have only 1 post published on the homepage from a particular category: <?php if ( have_posts() ) : ?> <?php ...
1
vote
3answers
2k views

Change date number to another language/script?

I previously was able to change the numbers of the date and time (into a number and date system of another language, like Khmer) for each post using a script like this in my functions.php: function ...
0
votes
1answer
147 views

Comparing Time with the_time();

I am trying to make a function that will check the time associated with a future event (cpt) with the current time, to see if the event has past. When I first collect the time it is in seconds and I ...
1
vote
0answers
59 views

Time Issue xx hours ago

I'm facing a strange issue, first time in my life :) After publishing a post/page/custom post type, it's tell that published 10 hours ago. It's happening always, for all posts. As I've deployed a VPS ...
0
votes
1answer
93 views

How can I compare publish and update dates for a single post?

In my theme, I'd like to display the publish date and (only) if the post was updated after the publish date, also display the updated date. The code in my theme now looks like this: */ stuff above ...
0
votes
1answer
36 views

Change the counter in terms of date

If I have a post or submit a date-field, I would like the counter to say 'this is in 3 days time'. i.e - on my site at the moment, (see here: http://www.universitycompare.com) I have dates for the ...
0
votes
1answer
60 views

Randomizing Post Links Outside of Loop - No Author or Date

I'm developing a home page that is a mishmash of a bunch of information, including a random smattering of several categories, including blog posts (category 192 in the code below) I'm obviously not ...
0
votes
1answer
342 views

How to handle dates, trying to calculate time since a post

I am trying to create a "time since" post display so when someone views a post they will see "posted about a week ago" instead of the date. I've tried a few things but to no avail and I think it is ...
2
votes
1answer
138 views

Query by custom dates in UNIX Time

I actually have a custom date registered in UNIX Time in my database like this: meta_key : custom_date meta_value : 1322697600 and the type of the meta key is a longtext I would like to retrieve ...
1
vote
1answer
174 views

Timezone UTC to PST

we are trying to figure out what's happening with our site's timezone. On general settings it shows that local time is correct while showing the UTC time next to it. The locale we have it as Los ...
1
vote
0answers
97 views

Posts published last 10 minutes

i have a "featured" section on home page. i want to hide this section after 10 minutes of post publish time. here is the code, i am using. problem is that it hide the "featured" section after 12 ...