looping though custom post types and only return results in a given taxonomy

Check the documentation here: http://codex.wordpress.org/Function_Reference/WP_Query#Taxonomy_Parameters You’ll want to add this to your wp_query: ‘smash-palace’ => ‘smash-palace’ In other words, your new query would look something like: $loop = new WP_Query( array( ‘post_type’ => ‘videos’, ‘artists’ => ‘smash-palace’, ‘post_child’ => 0, ‘posts_per_page’ => 5 ) ); EDIT: I answered this question under the assumption that “Smash … Read more

Proper use of wp_get_object_terms

To fetch the archive url for that taxonomy term, use something like this (I’m using your naming conventions above, and assuming that $theZielgruppe is a term object. $url = get_term_link( $theZielgruppe, ‘ge_zielgruppe_taxonomy’ ); To get the name, just use $theZielgruppe->name Is that what you’re looking for? EDIT The link above would then look like this: … Read more

Attaching a Custom Taxonomy to Posts?

You can use register_taxonomy_for_object_type function and if you say that the taxonomy is created by a plugin you can use the plugins_loaded hook, to make sure that taxonomy wast already registered so: add_action(‘plugins_loaded’,’add_custom_taxonomy_to_posts’); function add_custom_taxonomy_to_posts(){ register_taxonomy_for_object_type(‘TAXONOMY_NAME’, ‘post’); }

saving meta/custom field to tag

you can use wp_insert_term() to create the tag and then wp_set_object_terms() to set it as the custom post tag: //get the tag $tag = $_POST[‘ad_Tags’]; //create the tag $term_id= wp_insert_term( $tag, // the term ‘post_tag’, // the taxonomy array(‘description’=> ‘term description’,’slug’ => ‘term-slug’) ); //set the tag wp_set_object_terms( $post_id, $term_id, ‘post_tag’ );

Removing “trashed” posts from post count in custom taxonomy terms?

This is a known, reported WordPress bug. There are some workarounds, such as this one: add_action( ‘edited_term_taxonomy’,’wpse26548_edited_term_taxonomy’, 10, 2 ); function wpse26548_edited_term_taxonomy($term,$taxonomy) { global $wpdb,$post; //in quick edit mode, $post is an array() //in full edit mode $post is an object if ( is_array( $post )) $posttype=$post[‘post_type’]; else $posttype=$post->post_type; if ($posttype) { $DB_prefix=$wpdb->get_blog_prefix(BLOG_ID_CURRENT_SITE); $sql = … Read more