Archived Posts in Wrong Category

The problem is almost assuredly your custom loop. I am guessing that this is your problem: $category = get_the_category($post->ID); $category = $category[0]->cat_ID; Further, I’m guessing that the $post object being queried here has more than one category term defined. Thus, $category[0] is returning something other than “tutorials”. Easiest solution: ensure all posts only have one … Read more

How can I group posts by date on frontpage?

You test when the date changes and only show it once, right when it changed for the first time. <?php $date = 0; $newDate = true; if (have_posts()) : while (have_posts()) : the_post(); if ($date == 0) $date = the_date(); else if ($date != the_date()) { $date = the_date(); $newDate = true; } if ($newDate) … Read more

multicheck box for post metabox

I took the example code you suggested and changed the following to get multicheck support: // Add this at the end of the file // A good prefix for your name prevents problems later! function wpse6513_get_meta_check( $args = array(), $current_values = array() ) { extract( $args ); $name_esc = esc_attr( $name ); if ( ! … Read more

Navigation link to specific user page

While you could possibly add a filter to walker_nav_menu_start_el and have your callback function alter/recreate the menu item according to your needs, I would say the best and easiest solution is to implement you own menu walker, and supply that to wp_nav_menu. This should help get you started: class WPSE_90204_Walker extends Walker_Nav_Menu { function start_el( … Read more

Sort posts by activity date

I like the idea proposed in this comment. Connecting the posts table to the comments table seems like it’d be some super complicated SQL (well all SQL is complicated to me). Instead the link proposes that you add a post meta field to the post to hold the date of the most recent comment. add_action(‘comment_unapproved_to_approved’, … Read more