Get system timestamp in wordpress

You can use PHP’s date() function here, but usually first you’ll need to run date_default_timezone_set. UTC+1 looks like Central Europe time from what I can tell, so here’s what I’d run: <?php date_default_timezone_set(‘Europe/Berlin’); echo date( ‘D, d M Y H:i:s’, now() ); ?> That will print out the current time from your server. If you’re … Read more

Adding a class to last post in the_date

Its possible, you can get the next post date to compare using get_adjacent_post function change your code to this: <?php while ( have_posts() ) : the_post(); //hold current date $curent_date = $post->post_date; //fix the format to YYYY-MM-DD $curent_date = substr($curent_date,0,strpos($curent_date,” “)); $next_post = get_adjacent_post(false,”,false) ; if (!$next_post == ”){ //get next post’s date $next_date = … Read more

Query sub subpages based on specific date?

If you’re loading additional posts/pages, it’s better to use a new WP_Query instance. query_posts is only for modifying the main query. As for the dates, store them in a custom field in the format yyyy-mm-dd. You’ll use php’s date to get the current date, refer to WP_Query’s custom field parameters for how to query and … Read more

Setting Event to Expire Using Custom Metabox

Have a look at the Post Expirator plugin. The Post Expirator plugin allows the user to set expiration dates for both posts and pages. There is a configuration option page in the plugins area that will allow you to seperataly control whether or not posts/pages are either deleted or changed to draft status.

Comment time is same as the post time

Try to use the wp_list_comments function: http://codex.wordpress.org/Function_Reference/wp_list_comments It allows you to control the aspect of every comment, also the replies. Then, you define a callback function, which will be called when WordPress creates each comment. Your callback needs to start like this: function commnents_callback($comment, $args, $depth) { $GLOBALS[‘comment’] = $comment; global $post; // your HTML … Read more

How to handle dates, trying to calculate time since a post

You don’t need to know the user’s timezone, because time since the post was published is independent of timezone. WordPress sets your timezone to UTC so that internally, all dates are dealt with the same and consistent timezone. You should avoid using php functions, and instead use the WordPress provided functions. Incidently, human_time_diff() does exactly … Read more

Change the counter in terms of date

Hope these plugins will be helpful http://wordpress.org/extend/plugins/date-in-a-nice-tone/ http://wordpress.org/extend/plugins/wp-relativedate http://www.jasonhendriks.com/programmer/dynamic-dates/dynamic-dates-examples/

Can i show items based on the day with php?

Most probably off-topic question… You can use: $var = date(“D”); to get the current day of the week. Then make a switch or a series of if-else to choose which posts you’ll want to display for that day.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)