Modify Term Update Redirection

I agree with you, it’s somewhat an unexpected user experience, when you’re redirected after updating a term. Additionally there seems to be no error handling on the form itself, if you try to make some errors, like deleting the term name and slug, it will not show any errors, just ignore your changes and redirect. … Read more

How to paginate a list of custom taxonomy terms?

Your shortcode is extremely expensive to run. get_term_link() is not user friendly when you feed it with term ID’s as it results in a db query to query the term object. If you feed the term object to get_term_link(), it is happy and do not need to do any work to get the term object. … Read more

Widget to display custom taxonomy tag cloud

Don’t know of any but you can easily create your own: <?php add_action(“widgets_init”, array(‘Widget_Custom_tax_tag_cloud’, ‘register’)); class Widget_Custom_tax_tag_cloud { function control(){ echo ‘No control panel’; } function widget($args){ echo $args[‘before_widget’]; echo $args[‘before_title’] . ‘Your widget title’ . $args[‘after_title’]; $cloud_args = array(‘taxonomy’ => ‘Your taxonomy here’); wp_tag_cloud( $cloud_args ); echo $args[‘after_widget’]; } function register(){ register_sidebar_widget(‘Widget name’, array(‘Widget_Custom_tax_tag_cloud’, … Read more

Limit the number of posts in query_posts function with custom post types

Something like this is what you need. The Codex page for WP_Query is very helpful $args = array(‘post_type’ => ‘<your custom post type name>’, ‘posts_per_page’ => 5, ‘tax_query’ => array( array( ‘taxonomy’ => ‘<your custom taxonomy name>’, ‘field’ => ‘slug’, ‘terms’ => ‘event-england’ ) ) ) $query = new WP_Query($args)

Populate Taxonomy from Custom Posts

I always use something like: add_action(‘save_post’, ‘mdz_correlate_casos_taxonomy’); function mdz_correlate_casos_taxonomy( $post_id ){ if ( defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE ) return $post_id; if ( ‘YOUR CUSTOM POST TYPE’ == $_POST[‘post_type’] ){ if (!wp_is_post_revision($post_id)){ if (!term_exists( $_POST[“post_title”], ‘YOUR CUSTOM TAXONOMY’ )){ $termid = wp_insert_term( $_POST[“post_title”], ‘YOUR CUSTOM TAXONOMY’ ); } } } } But this is prone to get … Read more

Get custom post type by category in a page template

This is a version of a function I’m using in the framework I’m working on, with example html replacing another function that contains something like it. // Custom Loop function arrr_custom_loop( $r_type=”post”, $r_post_num, $r_tax = ‘category’, $r_terms=”featured” ) { $args = array( ‘showposts’ => $r_post_num, ‘tax_query’ => array( array( ‘post_type’ => $r_type, ‘taxonomy’ => $r_tax, … Read more

How to modify URL structures in custom post types and taxonomies or terms

I’m not sure it’s possible, or perhaps it just may not be the best approach. Here is my reasoning: domain.com/post-type-name/taxonomy-name/term-name/post-title/ Posts can be attached to multiple terms, so in essence there could be multiple links to the same post: domain.com/post-type-name/taxonomy-name/term-name/post-title/ domain.com/post-type-name/taxonomy-name/term2-name/post-title/ domain.com/post-type-name/taxonomy2-name/term3-name/post-title/ domain.com/post-type-name/post-title/ Depending on how you got there. You will definitely be able to … Read more