How to mark every 3rd post

My approach. No extra function, no filter. 🙂 <?php $GLOBALS[‘wpdb’]->current_post = 0; ?> <div <?php post_class( 0 === ++$GLOBALS[‘wpdb’]->current_post % 3 ? ‘third’ : ” ); ?>> Alternative: <div <?php post_class( 0 === ++$GLOBALS[‘wpdb’]->wpse_post_counter % 3 ? ‘third’ : ” ); ?>>

Daily posts like an archive

The function wp_get_archives as far as I know this will only output a list. Instead use the WordPress loop and WP Query’s Date parameters. For example to get yesterdays posts using WP_Query you can do something like: $yesterday = date(‘d.m.Y’,strtotime(“yesterday”)); $yesterdayarray = date_parse($yesterday); $query = new WP_Query( ‘&day=’ . $yesterdayarray[“day”] ); // grab the data … Read more