Custom Taxonomies in Vantage and the front end form
I have made 2 custom taxonomies to help to further distinguish business listings 1)location, 2)tribe (nation-confederacy).
I have registered these taxonomies in my child themes function.php see (a) below.
I have also included a taxonomy link in my child’s single-listing.php (b) which then displays my custom taxonomies all of which works great. Using wp_dropdown_categories() I have got these Taxonomies to display in form-listings.php (c) so they appear in the create a listing form.
My problem is, is that when the form is submitted, the selections for my custom taxonomies are NOT submitted and I’m not sure how to fix this. I have tried wp_set_object_terms() in listings-form.php, but still have not been able to get it to work….
The reason I am not using the custom forms for this part is because I have also got a multiple custom taxonomy selecting plugin (http://codecanyon.net/item/taxonomie..._author=waylay) on the homepage, using drop down menus to be able to be VERY specific about what business listings are displayed…. It is a bit tidier that just the search bar. I just can’t get the front end users selection of their custom tax to be submitted to the database with the form….. Any help would be appreciated!
(A) = register my taxonomies in function.php:
// Add custom taxonomies
add_action( 'init', 'business_listings_create_taxonomies', 0 );
function business_listings_create_taxonomies()
{
// Business Location
$country_lables = array(
'name' => _x( 'Business location', 'taxonomy general name' ),
'singular_name' => _x( 'Business location', 'taxonomy singular name' ),
'search_items' => __( 'Search via business location' ),
'all_items' => __( 'All business locations' ),
'most_used_items' => null,
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit business locations' ),
'update_item' => __( 'Update business locations' ),
'add_new_item' => __( 'Add new business location' ),
'new_item_name' => __( 'New business location' ),
'not_found' => __('No business locations found'),
'not_found_in_trash' => __('No business locations found in trash'),
'menu_name' => __( 'Business Locations' ),
);
register_taxonomy('businesslocation',array('listin g'),array(
'hierarchical' => true,
'labels' => $country_lables,
'show_ui' => true,
'query_var' => true,
'rewrite' => array('slug' => 'business_location' )
(C) show drop down menu in front end form - however this is not submitted with the form for some reason!!!
<div class="form-field"><label>
<?php _e( 'Your Business Location:', APP_TD ); ?>
<?php wp_dropdown_categories( array(
'taxonomy' =>businesslocation,
'hide_empty' => false,
'hierarchical' => true,
'name' => 'businesslocation_name',
'id' => 'businesslocation',
'selected' => $listing->businesslocation,
'show_option_none' => __( 'Select Business Location:', APP_TD ),
'class' => 'businesslocation',
'orderby' => 'name',
'include' => $listing_cat,
'hide_if_empty' => false
) ); ?>
</label></div>