The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
1answer
149 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 ...
2
votes
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
180 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
109 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
39 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
381 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
158 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
192 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
111 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 ...
2
votes
1answer
438 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 ...
0
votes
1answer
573 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. ...
3
votes
1answer
838 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 ...
3
votes
1answer
84 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
1k 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 ...
2
votes
3answers
3k 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
127 views

How to show certain data on certain interval of period

I have three sets of period of time, each with several interval of date: Event A Jan 1 - March 1 Dec 1 - Dec 31 Event B Mar 2 - April 15 Jun 1 - Jul 15 Sept 1 - Oct 15 Event C Apr 16 - May 31 Jul ...
0
votes
1answer
688 views

Date time doesn't show correctly in qTranslate [closed]

I've used qTranslate to enable multiple languages on site. It works fine except for date-time for english language. Here are screenshots: Serbian: English: Languages settings looks like: How ...
0
votes
1answer
530 views

PHP time function ($today) for GMT +1

I tried a lot - But the code at the bottom is always 1 hour behind the local time. It might be a problem of the server-time. But I want to use it for a german website - So I have to set the time to ...
0
votes
1answer
63 views

Comment time is same as the post time

Here is my comments.php: http://pastebin.com/E5bz4aaW The problem is that the threaded comment (the reply) showing my post date instead if the comment date. I checked in the database and it looks ...
0
votes
2answers
340 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" ...
0
votes
1answer
64 views

Query sub subpages based on specific date?

I have an Events section as follows: ⤍ Page 1) ∟ Subpages 2) ∟ Sub subpages 1) Own template, w/o sidebars, but query_posts() and get_title/excerpt() from N°2 2) Other subpages are ...
0
votes
1answer
12k 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 ...
4
votes
4answers
7k 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 ...
0
votes
1answer
937 views

Time & Date on Post - Time Ago Custom Function

I'm using the following custom function to display the timestamp for a post as posted "X minutes ago" or "X days ago" for 14 days and then this changes to the actual date (e.g. 17th December 2010): ...
-2
votes
1answer
56 views

Display the last date, regardless of articles

i would like to display a date on my Blog. I have used this Code for displaying the date: <?php the_time('l, j. F Y'); ?> But that uses the time of the latest article. How can i display the ...
0
votes
2answers
623 views

Human time difference in months instead of days. How?

I use the following code in my template. <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?> It shows like 2 days ago, 20 days ago, 90 days ago. Is there a ...
1
vote
4answers
9k views

Proper formatting of post_date for wp_insert_post?

What is the proper way to define the post date when submitting a post from the front end using wp_insert_post (Trac)? My snippet now is publishing with the mysql time... if (isset ($_POST['date'])) ...
0
votes
1answer
1k 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, ...
1
vote
1answer
163 views

Calculate future date

I want to calculate a future date based on the date the post is published and use it in the content of a post. I can echo the post publication date using: echo the_date('Y-m-d'); How can I ...
0
votes
1answer
638 views

Display upcoming events in the next 30 days by querying posts with timestamp in custom meta

I have a custom post type "event" which stores a custom meta as a timestamp ($event_date). The date is always in a dd-mm-yyyy format, so I can generate a unix timestamp from this key. The timestamp ...
0
votes
1answer
585 views

How can I wrap html around the output of the_time function?

My current code in functions.php: echo '<div class="post_date">'.the_time('d', '<div class="month">', '</div>').the_time('F', '<div class="day">', ...
1
vote
0answers
484 views

How to remove/exclude specific posts in a category from RSS feeds after particular date [closed]

I want to remove/exclude some posts of a category from RSS feeds after particular date. First of all i want to specify that same requirement i already accomplish for front page posts. I have two ...
4
votes
1answer
2k views

Custom Post Type Archives by Date with Custom Permalink

I'm a bit stuck with getting the custom permalink for custom post type (CPT) archive to work. I've registered my 'press_release' CPT as following: add_action('init', 'press_release_post_type_init'); ...
6
votes
2answers
4k views

Default timezone hardcoded as UTC?

While debugging a plugin I was writing, I noticed that on line 36 of wp-settings.php, the default timezone is hardcoded to UTC with a call to the date_default_set_timezone() function. This means any ...
0
votes
1answer
4k views

Convert a date to ISO8601 date format

This is more of a PHP question than a WordPress one. I have a custom post type event that by default outputs the date as "September 11, 2011 9:00 am" format. I'm trying to format the post in ...
6
votes
2answers
3k 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
161 views

How to change a meta value (of a published post) after X days.?

I have a custom field. I would like to change the text of that custom field after x days. I want something like this: if ( published post is more than 90 days old ) { echo "your post is more ...
2
votes
2answers
386 views

Display future posts?

Is there a way to display posts, scheduled for the future? I want to use the published data as an event date and time, which is obviously in the future. I still would like to use these posts for a ...
0
votes
3answers
637 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!!
-1
votes
1answer
117 views

Standard API for rendering a date form

I'm hoping to enhance an existing plugin's setting page by adding an 'end date' form. I know how to add text and other form fields but was wondering if there is standard function that will render a ...
0
votes
1answer
85 views

Timed post and tweet?

I'm new to wordpress. Is it possible to say i would like to make this article public on this day and time AND have wordpress tweet it? Possibly tweeting the subject+link or a twitter msg i add in + ...
1
vote
1answer
320 views

Change the 'published on' text?

I am using the date and time in the post dialogue to log the date and time of future events, and would like to change the text to reflect that. Is there an action hook I can tap into to achieve that? ...
1
vote
1answer
586 views

Wordpress Locale Switching on Accept-Language Header

Is there anyway to get wordpress to automatically switch locales based on the HTTP Accept-Language header? Similar to how ASP.NET can do it with their globalization="auto" config setting. The reason ...
2
votes
1answer
1k 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 ...
3
votes
1answer
2k views

Display last login time

I am using this script to get the last time a user logged in function get_last_login($user_id) { $last_login = get_user_meta($user_id, 'last_login', true); echo human_time_diff($last_login) . ...
1
vote
4answers
2k views

wrong php date()?

hey guys, it's weird and I've never experienced that before. I've created a new blog and a custom theme. I'm using <?php echo date("H:i"); ?>in my theme. The time that's put is 2h earlier. ...
2
votes
1answer
1k views

How to Delete Old Comments by Date?

I run a contest/giveaway blog at www.mommylivingthelifeofriley.com and currently have over 160,000 comments on 1100 posts. I would like to find a way to delete all comments from my site which are ...
3
votes
3answers
1k 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 ...