Why is my taxonomy template not shown?
you have to use archive-projects.php to work mysite.com/projects, that’s all
you have to use archive-projects.php to work mysite.com/projects, that’s all
The answer to the question is in the two following posts: Permalinks in Custom Post types Remove taxonomy slug from a custom hierarchical taxonomy permalink You need to ignore the automated rewriting, as I have done, but you need to add $wp_rewrite->use_verbose_page_rules = true; to the mix, otherwise your pages will conflict with the rewrite … Read more
You can just use: /2011/08/?taxonomy=term I’m not sure how to create a rewrite rule though to make it “pretty”
Custom fields for custom taxonomies are nothing more than custom templates. For example, you can remove the template of the post_tag taxonomy via remove_meta_box() function and add custom template via add_meta_box() function. Examples Remove tags template: /* Remove default post tags template. */ add_action( ‘admin_menu’ , ‘example_remove_taxonomy_template’ ); /** * Remove taxonomy template * * … Read more
You can hook into the edit form field action of that specific taxonomy. If you look in /wp-admin/edit-tag-form.php there are hooks for every taxonomy. Starting at Line 69: if ( ‘category’ == $taxonomy ) do_action(‘edit_category_form_fields’, $tag); elseif ( ‘link_category’ == $taxonomy ) do_action(‘edit_link_category_form_fields’, $tag); else do_action(‘edit_tag_form_fields’, $tag); do_action($taxonomy . ‘_edit_form_fields’, $tag, $taxonomy); So for a … Read more
Like Justin Tadlock says in your referenced article, the body_class() provides the ability to add classes dependant on the type of term. Given that you indicate your php knowledge is still growing; this maybe the best solution. The codex provides a list of classes on a body_class enabled: http://codex.wordpress.org/Function_Reference/body_class If that isn’t sufficient; wordpress has … Read more
Try this code. <?php $taxonomy = ‘authors’;// e.g. post_tag, category $param_type=”authors”; // e.g. tag__in, category__in $term_args=array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’ ); $terms = get_terms($taxonomy,$term_args); if ($terms) { $first_letter = null; foreach( $terms as $term ) { $flag = 0; if( $first_letter != substr( $term->name, 0, 1 ) ) { $first_letter = substr( $term->name, … Read more
It’s a bug: http://core.trac.wordpress.org/ticket/18958
See the Codex. The wp_list_categories allows you to set a child_of and a depth (in this case 1, we only want to go one level down). See the link to the Codex about styling it; there’s a whole host of options. <?php $term = get_queried_object(); wp_list_categories(array( ‘taxonomy’=>$term->taxonomy, ‘child_of’=>(int) $term->term_id, ‘hide_empty’=>0, ‘depth’=>1, )); ?> I’ve only … Read more
If you use WP_Query‘s tax_query, you can set the operator to NOT IN and then just list your terms. The best way to do this (IMO) is to generate the tax query separately and dynamically, since all that will be changing in each of the different arguments is the slug/id of the category name. Your … Read more