wp_insert_post and custom taxonomy

Well I found the answer. The code is correct. Wordpress do in taxonomy.php Line 3392 $count += (int) $wpdb->get_var( $wpdb->prepare( “SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status=”publish” AND post_type IN (‘” . implode(“‘, ‘”, $object_types ) . “‘) AND term_taxonomy_id = %d”, $term ) ); $count is empty because post_status=”publish” in … Read more

How do I display post count of a custom post type with custom category taxonomy in wp_menu_nav?

Here is your solution- add_filter( ‘wp_setup_nav_menu_item’,’the_dramatist_item_setup’ ); function the_dramatist_item_setup($item) { if (‘taxonomy’ === $item->type) { $posts = get_posts( array( ‘post_type’ => ‘post’, ‘numberposts’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘id’, ‘terms’ => $item->object_id, // Where term_id of Term 1 is “1”. ‘include_children’ => false ) ) ) ); $item->title = … Read more

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