How to hook get_terms() to only show count of posts that have custom meta

As far as I remember counts for terms are stored in database, so there is nothing to modify when you fetch them – you simply get ready-made numbers. So you will either need to implement and maintain your special logic for counts completely separately or try to recalculate and modify native counts, see wp_update_term_count_now().

Best way to arrange custom post types by Attributes -> Order metabox value?

This did it: add_filter( ‘pre_get_posts’, ‘my_get_posts’ ); function my_get_posts( $query ) { if ( is_home() && false == $query->query_vars[‘suppress_filters’] ) $query->set( ‘post_type’, array( ‘jwf_portfolio’, ‘attachment’ ) ); $query->set(‘orderby’, ‘menu_order’); $query->set(‘order’, ‘ASC’); return $query; } No need to mess with index.php now.

How I check if the same post slug has not been used before publishing?

The Ajax way (a little bit dirty, but you can easily enhance it) In your functions.php (or in a plugin, or every where else) : function my_ajax_update(){ if (isset($_POST[‘title’])){ global $wpdb; $title = esc_sql($_POST[‘title’]); if(!$title) return; $page = $wpdb->get_results(” SELECT * FROM $wpdb->posts WHERE post_title LIKE ‘$title’ AND post_type=”event” AND post_status=”publish” LIMIT 1 “); if … Read more