Custom taxonomy huge list not loading properly in select box

Just like i commented , this will create the dropdown if it doesn’t exists and will save it in the database remove_meta_box(‘tagsdiv-book_author’, ‘book’, ‘normal’); add_meta_box(‘custom-taxonomy-author-dropdown’,’Author’,’author_dropdowns_box’,’book’,’side’,’high’); function author_dropdowns_box( $post ) { wp_nonce_field(‘custom-author-dropdown’, ‘author-dropdown-nonce’); echo “Author:”; echo “<select id=’bauthor’ name=”bauthor[]”>”; echo “<option value=”0″>None</option>”; $options = get_option(‘bauthor_dropdown’); if ($option !== false){ echo $options; }else{ $options=””; $terms = get_terms( … Read more

List one post only from each subcategory using get_posts?

I’m not sure this is the best way but it works: //First get all child categories if ‘big_corporates’ $categories = $args = array( ‘parent’ => $big_corporates_ID, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => 1, ‘taxonomy’ => ‘projects_category’ ); //then loop over them and get the first post of each: echo ‘<ul>’; foreach ($categories as … Read more

Catch all taxonomy template

I had a similar issue. I ended up using the archives.php and had a little more luck with that. It would see and use the archives.php (and the archives-video.php I created from it), but would not see taxonomy.php or taxonomy-videos.php or category.php like it should.

How to create Custom Taxonomy Search Drop Down for specific Post Type

First create a function to display your search form function display_custom_search_form($atts){ $return = ‘<form role=”search” method=”get” id=”searchform” action=”‘.home_url( “https://wordpress.stackexchange.com/” ).'”> <div><label class=”screen-reader-text” for=”s”>Search for:</label> ‘.wp_dropdown_categories(array(‘name’ =>’taxTerm’, ‘taxonomy’ => ‘TAXONOMY_NAME’).’ <!– this is the magic field you will need to change in order for this to work with each post types—> <input type=”hidden” name=”post_type” value=”post” /> … Read more

wp_set_post_terms example?

Name your fields like car_specs[taxonomy_name], then within “save_post” just do: foreach($_POST[‘car_specs’] as $tax => $term) if(taxonomy_exists($tax)) // && term_exists($term, $tax) wp_set_post_terms($post_id, $term, $tax); Personally I wouldn’t use WordPress for a auto classifieds type of website. There are PHP frameworks out there better suited for building such sites

Related “custom post type” using “custom taxonomy”

Assuming that you are on a taxonomy or term page then you can simply use: //get current term $term_slug = get_query_var( ‘term’ ); //get current taxonomy $taxonomyName = get_query_var( ‘taxonomy’ ); $loop = new WP_Query( array( ‘post_type’ => ‘work’, ‘posts_per_page’ => 10, ‘orderby’ => ‘ASC’, $taxonomyName => $term_slug); while ( $loop->have_posts() ) : $loop->the_post();