The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
28 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
18 views

Keep pending post date as publish date

Is there some function which will set publish date of post same as pending date? I wish to keep pending time as published time, to prevent WP from using time when post is published as published date. ...
0
votes
1answer
53 views

Pull 'Popular Posts' within specific timeframe

I'm looking to display a weekly list of 'Popular Posts' on a site. Currently the list shows a 'Popular Posts' column but these are posts from no particular timeframe. It's displaying the most popular ...
0
votes
1answer
43 views

Test date object against previous date in loop

I'm working on a page which displays a list of radioshows sorted by date and time. The radioshow is a custom posttype with a name, pic, description and date/time info. There is a variable number of ...
0
votes
0answers
18 views

Jetpack Post by Email at specific Date and Time?

Currently, I can post by email using the Jetpack plugin and I can use the [delay] shortcode to set the date it should be published. However, I need to set the time of day it should be published as ...
0
votes
1answer
17 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 ...
0
votes
2answers
24 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 ...
-1
votes
1answer
40 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
46 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 ...
0
votes
2answers
57 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 ...
0
votes
1answer
29 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 ...
0
votes
0answers
14 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
20 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
54 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
103 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
20 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 ...
1
vote
0answers
33 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
219 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
321 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 ...
4
votes
2answers
187 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
0answers
182 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 ...
1
vote
1answer
114 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
354 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 ...
0
votes
0answers
64 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 ...
0
votes
1answer
210 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 ...
2
votes
1answer
689 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
58 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
54 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
127 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
61 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
145 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
18 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
128 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
294 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
45 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
357 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
101 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
238 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
546 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
64 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
107 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 ...
0
votes
1answer
172 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
488 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
1answer
389 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
83 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
2k 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
44 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
97 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
72 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 ...