The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
17 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 ...
1
vote
1answer
50 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
0answers
24 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
22 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
63 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
46 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 ...
0
votes
3answers
57 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
14 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
66 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
189 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
25 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
124 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
71 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
106 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
222 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
41 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.
0
votes
0answers
55 views

Widget on home page displays wrong time compared to same widget on inside pages

I am trying to use the timely events calendar and I have the upcoming events widget on my home page widget area. The time that displays is not the time I have selected. When I put the same widget to a ...
1
vote
1answer
76 views

How to get date using timezone saved in options? [duplicate]

This code does not work correctly and returns time using timezone from computer and ignoring timezone stored in WordPress options: date_default_timezone_set( get_option( 'timezone_string' ) ); $hours ...
0
votes
2answers
162 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 ...
1
vote
1answer
185 views

Wordpress Custom Query to show posts from last x years

I have found a way to show all posts from the current year with this code: <?php $today = getdate(); $lastyear = $today[ 'year' ]; $args = array( //'nopaging' => true, 'paged' => ...
0
votes
0answers
59 views

Save user login date

I want to save the last login date but it doesn't work properly. It saved the first time I logged but then when I logout and loggin it doesn't change the last login time. (Stay the same) add_action ( ...
0
votes
1answer
600 views

post_date_gmt and post_date [duplicate]

I am inserting posts programmatically using wp_insert_post. A typical call would look like this: $news_item = array ( 'post_title' => $titleField, 'post_content' => ...
0
votes
0answers
38 views

Fetching Post based on date

I am creating a website for fetching post based on date, So when the page load it display the post of current date and in that page there are two button Previous and Next so when the user click on ...
1
vote
1answer
49 views

php console log speed [closed]

How do I log speed benchmarks to a console in php? I don't want to echo the results for the user to see, but just in some kind of log. I know that I can get the time elapsed with this: $first = ...
0
votes
3answers
50 views

Comparing Dates from custom field

I am trying to compare dates from a custom field. I have them stored as something like "20121125". If the date has expired, a placeholder image will be used, if not, the default thumbnail will be ...
0
votes
1answer
90 views

change the post time on multiple posts

I have about 60 posts queued and ready to post on specific dates, but I forgot to set the post time. I really don't want a bunch of posts posting at 3AM, so I need to change the times on all these ...
0
votes
2answers
120 views

How to second orderby in “pre_get_posts” by meta value or combine single date and time to timestamp

This is somewhat of a continued problem from another question that I had asked. Here is the original post. pre_get_post filter returns results when there should not be Since then I added an orderby ...
0
votes
1answer
73 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
131 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
278 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
63 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
164 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
40 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
132 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
161 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
348 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
146 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
39 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
119 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
240 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
221 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
1answer
616 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
162 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
141 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
161 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
369 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
98 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
210 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
60 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?