Individually styling date month year [closed]

As suggested, you can break down the date format in different parts. echo ‘<span class=”date-day”>’ . get_the_date( ‘d’ ) . ‘</span>’; echo ‘<span class=”date-month”>’ . get_the_date( ‘M’ ) . ‘</span>’; echo ‘<span class=”date-year”>’ . get_the_date( ‘Y’ ) . ‘</span>’; Now each item have class associated with it, so you can style each differently as you … Read more

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

To print relative time on posts automatically we can use get_the_date filter. We will check the time difference and print it in human readable form. // Relative date & time function wp_relative_date() { return human_time_diff( get_the_time(‘U’), current_time( ‘timestamp’ ) ) . ‘ ago’; } add_filter( ‘get_the_date’, ‘wp_relative_date’ ); // for posts add_filter( ‘get_comment_date’, ‘wp_relative_date’ ); … Read more

WP Cron job every 1st and 15th of the month

wp_cron operates on intervals and there is no interval that will hit exactly the first day and the 15th of every month. You could run your wp-cron job every day and check the date, similar to this but with a simple callback like: cron_callback_wpse_113675() { $date = date(‘d’); if (’01’ == $date || ’15’ == … Read more

Query by custom dates in UNIX Time

PHP has a built-in date() function that formats Date-objects. In your case, you would use it as follows: echo date(‘Y’, 1322697600); Since you’re using these query arguments to build up an array of posts, and you want to filter specifically on that, I’d recommend building a function that triggers the loop based on your desired … Read more

Register script/style: Is it possible to customize the version query string via plugin?

Old answer (based on misconception that you wanted a cache buster): You can use add_query_arg() which adds/replaces query arguments. <?php /** * Plugin Name: wpse_84670 * Version: 0.0.1 * Description: replace script/style version with time as a cache buster */ /** * replace script or stylesheet version with current time * @param string $url the … Read more

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