Return single taxonomy term outside the loop
$taxonomy = ‘taxonomy-name-here’; $queried_term = get_query_var($taxonomy); $term = get_term_by( ‘slug’, $queried_term, $taxonomy ); echo $term->name;
$taxonomy = ‘taxonomy-name-here’; $queried_term = get_query_var($taxonomy); $term = get_term_by( ‘slug’, $queried_term, $taxonomy ); echo $term->name;
Google is finding those pages because you’re linking to them. Most likely this happens when you use the media uploader and hit the “insert into post” button. Unless you tell it otherwise, WP will link to the attachment page intead of the image file. So head to your pages and remove the links to attachment … Read more
The following answer by Jan Fabry should help you solve your problem. It had helped me. Mixing custom post type and taxonomy rewrite structures?
I believe you can just use the WP_Query method to query the database with a tax_query like so: $my_query_args = array( ‘post_type’ => ‘shows’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘location’, ‘field’ => ‘slug’, ‘terms’ => ‘california’ ), array( ‘taxonomy’ => ‘genre’, ‘field’ => ‘slug’, ‘terms’ => ‘comedy’ ) ) ); $my_query … Read more
Simply add the ‘category__in’ => $category_id_array argument from your second query inside your first query. If this doesn’t work, make a tax_query, with both kund and post_category taxonomies
What I want to do is create a “category page” for each category That would be category archive, not page. See category templates. As all of my “product detail pages” are pages, and not posts, I’m not sure how to set up my taxonomies. It would make sense to create custom post type for your … Read more
It is actually quiet easy using WP page template and taxonomy templates (Why do you want to display all results on one page? I think it is better when you URLs will have some logical structure). You can create new page template and use wp_list_categories function: <?php /* Template Name: Taxonomy Terms */ get_header(); ?> … Read more
get_terms(‘apptypes’,’orderby=id&parent=0′); parent argument is used to get direct children of this term (only terms whose explicit parent is this value). If 0 is passed, only top-level terms are returned. Default is an empty string. See Codex.
Try using this function to avoid your problem: function sld_unregister_taxonomy_from_object_type($taxonomy, $object_type) { global $wp_taxonomies; if ( !isset($wp_taxonomies[$taxonomy]) || !get_post_type_object($object_type) ) return false; foreach (array_keys($wp_taxonomies[$taxonomy]->object_type) as $array_key) { if ($wp_taxonomies[$taxonomy]->object_type[$array_key] == $array_key) { unset ($wp_taxonomies[$taxonomy]->object_type[$array_key]); return true; } } return false; } e.x.: function mwm_unregister_taxonomy(){ sld_unregister_taxonomy_from_object_type( ‘post_tag’, ‘post’ ); } add_action( ‘init’, ‘mwm_unregister_taxonomy’);
This will probably be easier to do when the following filter lands: http://core.trac.wordpress.org/ticket/18752 Update July 16. 2012: Fixed.