Plugin to assign parent category on multiple taxonomy terms
Perhaps Scribu‘s Term Management Tools would be of use to you here, it does various tasks including bulk term management.
Perhaps Scribu‘s Term Management Tools would be of use to you here, it does various tasks including bulk term management.
See Codex page for is_taxonomy This function is deprecated as of Version 3.0. Please use taxonomy_exists instead. wp_insert_term uses taxonomy_exists to check if the taxonomy exists. This means if the taxonomy is a registered taxonomy. (It would be odd if wp_insert_term only you allowed to add a term to taxonomies with existing terms 🙂 ) … Read more
I managed to make it work but not fully. First, the code you provided is not retrieving an already saved post_meta. I based my code in the introductory code of this tutorial: http://wpengineer.com/2076/add-custom-field-attachment-in-wordpress/ And am using the regular post_tag taxonomy instead of a custom one. And, lastly, there’s a bug, after you close the Media … Read more
I’m fairly certain that the taxonomies have nothing truly in common except posts that they share, so I think you can’t avoid running an actual query of posts, in order to learn which categories are candidates for your criteria. While, it may not be computationally the best method, you could do something like this… $args … Read more
I don’t know if you’ve tried this but try adding post_status => inherit to your query. I’ve found that get_posts defaults to publish and therefore will not return any attachments, since their post_status is always inherit. The codex page on get_posts confirms this. Edit: looking at your query again, you have term in the tax_query … Read more
Pass order parameter in url on click on link like /?order=DESC or if you are using a button then it must be submitting a form with order field value change GET to POST and field name if(isset($_GET[‘order’])){ $order = $_GET[‘order’]; } else{ $order=”ASC”; } $categories = get_terms( ‘category’, array( ‘orderby’ => ‘name’, ‘order’=> $order, ) … Read more
This seems to work, don’t know if it’s the correct approach. add_action ( ‘edited_’ . $taxonomy->name, function( $term_id ) use ( $taxonomy ) { $term = get_term( $term_id, $taxonomy->name ); });
I ended up using the wp_get_object_terms() function instead of get_the_terms(). The get_the_terms() function attempts to cache the terms where wp_get_object_terms() does not. The fixed code to get the hero images CPT’s ID is: $hero_image_id = ( $assigned_hero_images = wp_get_object_terms( $post_parent, ‘hero_images’ ) ) && ( $hero_image = array_shift( $assigned_hero_images ) ) && isset( $hero_image->term_id ) … Read more
I answered my own question I just implemented it wrong when testing it on my end (mis-typed the taxonomy). This is correct: // Change the number of posts that show up on the taxonomy template function custom_tax_post_count ( $query ) { if (($query->is_tax(array(‘taxonomy_1’, ‘taxonomy_2’)) )) $query->set( ‘posts_per_page’, ‘-1’ ); } add_action( ‘pre_get_posts’, ‘custom_tax_post_count’ );
Solved it with the following Custom Walker: class CustomWalker extends Walker_Category { function start_el(&$output, $item, $depth=0, $args=array()) { $output .= “\n<li><a href=\”http://website.com/?ls=&location=” . $item->slug . “\”>”.esc_attr($item->name); } function end_el(&$output, $item, $depth=0, $args=array()) { $output .= “</li>\n”; } }