The date-time tag has no wiki summary.
0
votes
3answers
2k views
Display posts starting from today date
How to display a list of posts from today date to future?
I am actually using this code:
<div id="news-loop">
<?php if (have_posts()) : ?>
<?php ...
0
votes
1answer
13 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 ...
0
votes
1answer
3k views
Get Wordpress current date/time
In my plugin, I am trying to get the current date/time of the blog into the code but it seems to be returning a odd date/time. If i put a new post on the blog it does show the correct date/time so I ...
3
votes
3answers
132 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
0answers
5 views
How to display the date in my own language [duplicate]
Hy, how can i display the date in my own language.
I neeed to get something like this: 21 Iunie 2013
Language ROMANIAN
0
votes
2answers
4k views
How to get the date of a post in WordPress, so I could use it in a script?
I'm very new to WordPress. I need to get the date of a post and compare that date to a specific date (04/01/2011), so add some banners and stuff to every post created "after" that pivot date. But the ...
0
votes
1answer
231 views
Get date function not working
I have a function to get the date. I have input fields and want the date in this fields. But my code is set a wrong date. I set the date in Wordpress settings and on my server. But it is not working. ...
1
vote
1answer
26 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
29 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 ...
3
votes
2answers
2k views
What's the difference between get_the_time and get_the_date?
Both function returns date and time. What's the difference between them? Do you have any example? Thanks.
0
votes
1answer
20 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?
3
votes
3answers
647 views
Set Custom Post Type title to the Post's Date
I have a custom post type, called 'status' and I have disabled 'title' in the post type. Right now it's setting all posts to have the title "Auto Draft". I want to set up a way to set the title to be ...
1
vote
1answer
25 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 ...
1
vote
2answers
70 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
82 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
32 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
2answers
65 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" ...
1
vote
1answer
99 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
1answer
175 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 ...
2
votes
1answer
712 views
How to filter a dd/mm/yyyy date from a custom field in a query
I'm trying to build a query in order to sort some posts by a date custom field, where the dates are formatted dd/mm/yyyy.
It works by querying the database directly with get_results like in this ...
2
votes
1answer
221 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 ...
0
votes
2answers
154 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
405 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
44 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 ...
8
votes
3answers
7k views
Order by meta value or date?
Got a custom field called startDate but its only on a few events. I was wondering if it isn't set for a post I could use post_date to generate the posts list?
// if meta_key _postmeta.startDate isn't ...
0
votes
2answers
85 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
176 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
72 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
84 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 ...
1
vote
3answers
974 views
Why time functions show invalid time zone when using 'c' time format?
These are the functions I use in my theme to display the "entry-meta" which includes published and last modified dates (among others) of an article:
// Shows Author and Published Date
if ( ! ...
0
votes
1answer
492 views
Media attachment date and post date
I have just migrated a massive site (2500+ users, 5000+ posts/images) to Wordpress using custom code. Basically every post has one image and that image is attached to the post as the featured image, ...
2
votes
1answer
205 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 ...
0
votes
2answers
219 views
Setting Event to Expire Using Custom Metabox
Working on a real estate website and setting Open House dates and times using drop downs in a Custom Meta Box. Example drop down below:
<select name="sale_listing_open_house1_start_day" ...
1
vote
1answer
92 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 ...
0
votes
2answers
453 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
86 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
49 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
41 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
30 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 ...
2
votes
1answer
94 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 ...
0
votes
3answers
401 views
change the year on all of my custom post types?
I need to change the published year on all of a custom post type from 2010, to 2011.
What is the quickest way to do it? I have 200 entries, so manual would take hours!!
0
votes
1answer
45 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
160 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 ...
1
vote
0answers
63 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 ...
1
vote
1answer
87 views
Finding difference in days
I want to store the current time using the update_option and then compare it if the set time was 3 days ago. I want to know in what format I should store the time? and then how can I compare it with ...
3
votes
1answer
278 views
Is it safe to use 'date_default_timezone_set' in plugin file?
I am using a sitemaps plugin which in very complex ways sets the timezone of <lastmod> (i.e. last modified time) for posts to GMT.
Temporarily, until the plugin developer fixes it, I need to ...
2
votes
1answer
1k views
Custom post admin filtering by post meta (the date)
I've created a custom post type for events that uses a custom field to retrieve the date for the event. It works ok and I'm able to filter the displayed results using meta_compare to compare the date ...
3
votes
4answers
4k views
Sorting a query by custom field date
EDIT: Reworded the question for more clarity
I'm trying to sort by custom meta box data, which I am converting to a date using the strtotime function, but I'm having some difficulty.
My chief ...
3
votes
1answer
69 views
How to display date such “x ago”
I want display date based on how much time has passed since, i. e. Posted 12 minutes ago
-1
votes
1answer
277 views
Separately formatting date elements
I am trying to achieve the following look in the time format:
I have for now several issues,
First is that the month and year are not displayed at all,
I use <?php the_date('D'); ?> <?php ...



