Any way to make custom taxonomy field searchable?

Here’s the code. You can change $post_type and $custom_fields according to your needs. function extend_admin_search( $query ) { // Extend search for document post type $post_type=”document”; // Custom fields to search for $custom_fields = array( “_file_name”, ); if( ! is_admin() ) return; if ( $query->query[‘post_type’] != $post_type ) return; $search_term = $query->query_vars[‘s’]; // Set to … Read more

Error in Custom Taxonomy UI

The issue at first glance appears to be here.. add_action(‘game_edit_form_fields’, ‘game_form_fields’); add_action(‘game_add_form_fields’, ‘game_form_fields’); function game_form_fields($tag,$taxonomy) { Your function is expecting 2 vars to be passed from the hook, but your add_action calls default to 1.. Eg, this.. add_action(‘game_edit_form_fields’, ‘game_form_fields’); Is equal to this.. add_action(‘game_edit_form_fields’, ‘game_form_fields’, 10, 1 ); The fourth parameters sets how many arguments … Read more

Loop custom post type by taxonomy (Category)

Before the loop starts use query_posts. Available parameters are here. Something like this: global $wp_query; query_posts( array( ‘post_type’ => ‘mycustomname’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘mytaxonomyname’, ‘field’ => ‘slug’, ‘terms’ => array( ‘myterm1slug’, ‘myterm2slug’ ) ) ) ) );