The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
12 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 ...
16
votes
4answers
14k views

How to get WordPress Time Zone setting?

Can someone tell me how to get the time zone that is set in the WordPress Admin? For example, if the blog is set to Eastern time, I need this exact string to print out: US/Eastern This is for a ...
1
vote
2answers
16k 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
0answers
12 views

Design: year of work creation: custom field, tax, something else?

Let's say I have to build a site for publishing old books and manuscripts or histories about those books and manuscripts. For many of them they knows a year of creation/publication, but for many ...
0
votes
2answers
17 views

Fixing UTC time - wordpress effects

my centos server has a wrong utc time (example: now it's 7.54 utc and my server shows 8.15 utc). I'll fix this, but which will be the effects on WordPress? There'll be problems with cookies/cache or ...
0
votes
2answers
29 views

Time Based change of image

Could someone please point me in the right direction, im currently using : <?php if (get_the_time('H') >= 8 && get_the_time('H') < 20) : ?> <img src="<?php echo ...
-1
votes
1answer
20 views

Show monthly or daily archives

My code is this: #http://localhost/wordpress/2015/04/01 if (is_day()) { } //Prints January, April, 2015 #http://localhost/wordpress/2015/04/ if (is_month()) { echo single_month_title(' '); ...
0
votes
0answers
29 views

Sort by a date field in a repeatable group

I'm using cmb2 WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress. I have a repeatable group for events with the meta_key 'date'. The repeatable group 'date' serialized array includes ...
1
vote
2answers
607 views

Why does this echo values in the wrong order?

I'm sure there is a simple reason/answer for this: Why does echo 'Archive for '. the_time('Y'); give me 2010Archive for? I had expected it would give me Archive for 2010
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" ...
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
1answer
21 views

Incorrect ordering of custom post type based on time

I have a custom post type as event which accept Custom fields' values as gp_event_date as ( 2015/02/26) gp_event_time as (SIMILAR) to 08:00PM - 10:00PM format. And on the list page, it orders the ...
6
votes
4answers
5k 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 ...
0
votes
0answers
13 views

Weekly scheduled date change

I am trying to get a date in a clients site to update every 2 weeks. I have it currently running to stay current, using '.date("M d, Y").' I want it to update to the current date on that ...
0
votes
0answers
16 views

Insert custom taxonomy into javascript

I have a simple javascript to display a future time. The script is executed from post's content. <script type="text/javascript"> <!-- var currentTime = new Date() ...
0
votes
1answer
39 views

Using WP_Query to re-query and sort results using a date?

I'm writing a function to find the users next upcoming event (stored as CPT), chronologically. If I use a normal query and do something like 'post_type' => 'ticket', // another CPT set up to act ...
0
votes
1answer
57 views

Changing default WP-Site creation date

I started creating WP-Site this January-2015 but as per my project I need to include posts which are from year 2007 I created posts with the required date now I used a calender which sorts posts when ...
0
votes
0answers
10 views

shortcode tomorrow date is (Arabic Language) [duplicate]

am using this function to print today date, tomorrow date, and after tomorrow date in function.php // [tomorrow] function displaydate_tomorrow(){ return date('l', strtotime('+1 day')); } ...
0
votes
1answer
16 views

wordpress blog posts's time

I want to show the blog posts'time like below: "A heading title , posted by XYZ, 1 hour ago" I want the time that says: 5 minutes ago, 1 hour ago, 2 days ago 1 month ago like that. how can i get ...
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 ...
3
votes
2answers
262 views

Ordering posts having multiple post-meta date fields

Hello WordPress developers. Over the years, I've found answers to many questions I've had with WordPress. I want to thank you for your help. Today, I have a question myself, and seek for expert ...
1
vote
0answers
29 views

Placed on + only date (not time)

When I create a comment or, ... you can set Placed on. For example: 20 june, 2014 on 14:23 . But I don't want the time (14:23). Only 20 june, 2014. Is this possible, and if so, how can I do this? ...
3
votes
2answers
118 views

Using WP_Query To Get Posts Randomly From today

In the logic of the data_query(); I found this WP_Query sample: <!-- Second Senses Featured --> <ul id="featuredSecond" class="featured-second"> <?php $today = ...
3
votes
2answers
144 views

How to schedule multiple posts while adding new

In a WordPress powered news portal, they need to upload many news at a time on a certain period of a day, in most of the cases, after 10pm (today). But they are actually inserting news for the next ...
0
votes
2answers
417 views

How can I show many posts an author has per week?

I've searched around and have had no luck or success in finding a way to show how many posts an author has made in a certain period of time (e.g. - a week) Any ideas on how one would approach this? I ...
2
votes
2answers
201 views

How do I create a dynamically-updated copyright statement?

I'd like to find an optimized, WP_Query-safe method for generating a dynamically-populated copyright statement for the bottom of my themes. That is to say, I'd like to check the date (by year) of my ...
0
votes
0answers
126 views

How do you add Author and date Published on Category Pages?

I made a category on my Wordpress site. when i write any post and tag it in the category, the post displaying on the category pages in a neat way, everything is fine. But Google webmaster tools are ...
0
votes
3answers
4k 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 ...
1
vote
1answer
89 views

Date query not inclusive despite parameter being true

I've set up a small test query to get some posts from October 1 to October 10. I published a post today ( October 10 ) and with the date query parameter of include set to true, I would have expected ...
0
votes
1answer
216 views

Relative time - how to calculate difference beween post publish date and current time

I want to calculate the difference between post's publishing time and current time, and I want to read that value as a number (number of hours, minutes, seconds whatever, i just want it to be a ...
1
vote
1answer
292 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
0answers
44 views

How to display time when page is created and edited

On posts I use this: Time created <?php the_time('Y-m-d'); ?> Edited (updated) <?php the_modified_time('Y-m-d'); ?> It works fine on posts, but on page template it displays just ...
1
vote
1answer
345 views

How to get the posts published in last two days using WP_Query?

I am trying to loop through all the post to get the top most shared posts on social network. I want to use the date_query parameter in the WP_query to get the posts of last two days , last 5 days, ...
0
votes
1answer
147 views

automatic send email at custom time

I want to send an automatic email every day at 10:00 I tried this code $timeN = date('H:i'); $timeS = date('10:00'); if ($timeS == $timeN) { $to = get_option('admin_email'); $nfrom = "my ...
12
votes
2answers
422 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 ...
0
votes
0answers
44 views

Menu of the Day?

I would like to show on a specific page a menu of the day, as well as a month calendar with the foods for each day listed. My current setup uses a plugin(Role Scoper) with some changes of my own to ...
0
votes
1answer
46 views

Block post updates and deletion after a set period

Trying to adapt the code from here to my use case: function wpbeginner_restrict_editing( $allcaps, $cap, $args ) { // Bail out if we're not asking to edit or delete a post ... if( ...
0
votes
0answers
95 views

WP_Query Sorting Posts by month … timeline effect

Hoping someone can take a look at my code and help me out. Right now I am trying to show my blog in a timeline style approach. My current query is generating the posts how I would like them to but I ...
0
votes
2answers
54 views

Change the date and time in wordpress

Is there a way to change the date and time in WordPress, not the timezone, but the date and time all together, like make it 03-21-85 11:11 PM. I want all dates and times to be changed, not just to one ...
2
votes
2answers
2k views

How would I bulk change posting date?

How would I bulk change posting date? I want to change about 20 post publish dates at a time in one click
0
votes
3answers
108 views

Show different time stamp based on time

What's the best way to show a time stamp based on different times? For example: if a post is under 24 hours, show %% mins/hours ago. If a post is over 24 hours, show month/day/time. If a post if over ...
0
votes
0answers
17 views

Change the date format

Sorry I'm newbee of wordpress. I want to change the format from Fri, 4 Oct 2014 to 04/10/2014. I changed the format from general - settings but still looks like same. I've already check this post : ...
0
votes
1answer
114 views

Default Timezone setting in WordPress - is that global?

Despite the WordPress Options' Timezone setting for the whole WordPress installation, is it necessary to declare the default timezone in all the date/time places in a WP theme/plugins? ...
2
votes
1answer
274 views

Custom Field sort not working (WP 3.8.1)

I am trying to sort a custom wp_query using the date format YYYYMMDD (php: date('Ymd') ). This will not be regarded as date field, but rather as a numeric one stored in custom field. My WP-QUERY code ...
1
vote
0answers
37 views

2 weeks ago from meta query meta value

This is my meta query within my posts query. 'meta_query' => array( array( 'key' => 'rw_membership_ends', 'value' => ??????? ...
0
votes
1answer
285 views

How to add a date creation field when a custom taxonomy relationship is created?

I need to display a list of posts and order it by date. The date of when the taxonomy term relationship was created. Is this possible? If so, how can I approach it? Thank you. EDIT - SOLVED! ...
0
votes
1answer
97 views

Replicate the_date function when using a custom field

I used to use the published date to sort posts on my page. Now I am sorting the posts with a custom date/time field. When using the published date I used the_date function, which only shows the date ...
0
votes
1answer
179 views

Date is wrong on 'all posts' page

The website i'm working on has a homepage with posts and at the end of the page a button with view more posts. When I click that button it sends me to 'all posts'. On this page I have a problem, the ...
1
vote
1answer
460 views

Advanced custom fields: Customise date picker's start date (need to choose year 1500 onwards) [closed]

In Advanced custom fields, I would like to customise the date picker so that, ideally, I can only select a year in the 1500s/1600s but at the very least allow the datepicker to go back to the 1500s. ...
1
vote
0answers
56 views

Display date and time in comments

I use wp_list_comments(); to display a list of comment in WordPress. But it does show the format characters instead of the correct datetime. How can I fix this bug? Thank you.