Fixing UTC time – wordpress effects

WordPress essentially completely ignores native PHP date functionality, in favor of its own handling. That traditionally allowed it to manage related aspects (such as timezones and translation) with no regards for server configuration. My educated guess that it would be largely oblivious to such change. At most the cron tasks might fire in bulk and … Read more

List taxonomy terms plus their latest post ordered by post date

Right now you are performing the query by term, and displaying results instantly. What you need is to gather the results of each query, sort them and then display separately. Make sure to read code comments. /* $custom_terms = get_terms(‘columna’); – this approach is depreciated */ $custom_terms = get_terms( array( ‘taxonomy’ => ‘columna’ ) ); … Read more

Use touch_time() on front-end form via plugin

You might try to include the the template.php file: <?php if( ! function_exists( ‘touch_time’ ) ) { require_once( ABSPATH . ‘/wp-admin/includes/template.php’ ); touch_time( 0, 0, 5 ); } ?> but I think it might be better to just copy the code from the touch_time() function into your own function and modify accordingly. Friday part of … Read more

How do I display posts by day?

You’d have to specify day, month, and year to get today’s posts: $my_query = new WP_Query( array( ‘cat’=>1, ‘year’=>date(‘Y’), ‘monthnum’=>date(‘m’), ‘day’=>date(‘d’), ‘posts_per_page’=>-1 ) ); Leaving day blank just doesn’t set that query var, so its not restricting your query at all.

Why does this echo values in the wrong order?

As most template tags that start with the_ this one echoes time and not returns it (which template tags that start with get_the_ do). First the_time() fires and echoes year, then its return (null) gets concatenated and echoed with string. So: echo ‘Archive for ‘; the_time(‘Y’); Or: echo ‘Archive for ‘ . get_the_time(‘Y’);

Modify Date Format to German

WordPress has a special function for translating dates, called date_i18n. General usage: echo date_i18n( $dateformatstring, $unixtimestamp, $gmt); Supposing you have German as your site’s language this would be: echo date_i18n( ‘j. F Y’, false, false); You can also import the time format from the admin settings, like this: echo date_i18n(get_option(‘date_format’), false, false);

Plugin for changing a post’s category based on it’s post date?

Don’t know of a plugin but you can use wp_schedule_single_event function. First create a meta box that takes to values: time for removal and what category we want to set it to when removed from featured. /* hook meta box */ add_action(“admin_init”, “admin_init”); /* hook meta box function */ function admin_init(){ add_meta_box(“Featured Removal”, “Featured Removal”, … Read more

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