How can I populate a select element with terms from a custom taxonomy and filter post results?

Are you familiar with jQuery? You’ll want to post the term to a admin-ajax, and use the response to populate the second select. Here is the codex documentation: http://codex.wordpress.org/AJAX_in_Plugins A loose example for your situation: $first_term = $(‘#states’); $name = $first_term.children(‘option:selected’).text(); var data = { action: ‘tag_slug’, slug: $slug }; var ajaxurl=”wp-admin/admin-ajax.php”; $.post(ajaxurl, data, function(response) … Read more

Querying two taxonomies

This helper function will return the ID of the term you are currently viewing (from any taxonomy – you can limit just to a specific taxonomy, or the built-in tag and category taxonomies). It will return false if you are not on a taxonomy term archive page. function wpse52578_get_current_term_id(){ if( !is_tax() && !is_tag() && !is_category() … Read more

Show only the grandchildren (using get_terms)

I think for each term you should check that it has a parent but not have any childern So you code may look like $taxonomy = ‘world’; $tax_terms = get_terms( $taxonomy ); foreach ($tax_terms as $value){ $args=array( ‘child_of’=> $value->term_id, ); //get all child of current term $child = get_terms( $taxonomy, $args ); if( $value->parent != … Read more

User: Editor, can’t see edit taxonomy screen

Right after I wrote the posts I found it…anyway if someone else is looking for the answer to this, you need to set capabilities when you register your taxonomy. You add the following: ‘capabilities’ => array ( ‘manage_terms’ => ‘edit_posts’, ‘edit_terms’ => ‘edit_posts’, ‘delete_terms’ => ‘edit_posts’, ‘assign_terms’ => ‘edit_posts’ ) edit_posts means administrator’, ‘editor’, ‘author’ … Read more