How to get slug of current category in taxonomy template?
You can get the term object of the category you’re viewing with get_queried_object(). That will contain the slug. $term = get_queried_object(); echo $term->slug;
You can get the term object of the category you’re viewing with get_queried_object(). That will contain the slug. $term = get_queried_object(); echo $term->slug;
You can use a {$taxonomy}_edit_form_fields action hook to add html to the term edit table. In that HTML you can remove description textarea and add tinymce editor add_action(“{$taxonomy}_edit_form_fields”, ‘add_form_fields_example’, 10, 2); function add_form_fields_example($term, $taxonomy){ ?> <tr valign=”top”> <th scope=”row”>Description</th> <td> <?php wp_editor(html_entity_decode($term->description), ‘description’, array(‘media_buttons’ => false)); ?> <script> jQuery(window).ready(function(){ jQuery(‘label[for=description]’).parent().parent().remove(); }); </script> </td> </tr> <?php … Read more
I’m assuming that you don’t want to set different labels for these taxonomies in the first place – you didn’t specifically mention that you can’t, but I’m assuming the thought occurred to you. Just in case it didn’t, from your code: register_taxonomy(“product_cat”, “product”, array( “labels” => array( “name” => “Categories”, Changing “Categories” to “Product Categories” … Read more
My recommendation would be to place the code that defines your custom taxonomies into a plug-in and activate the plug-in site wide. This will cause the new taxonomies to become active on all the sites in your network.
Get rid of the filter that you have. Make sure that you use ‘rewrite’ => array( ‘hierarchical’ => ‘true’ ) in your register_taxonomy() function. Don’t forget to flush the rewrite rules. See this page for more info: Codex
It is possible to register a taxonomy without associating a post type by passing null as your argument for the $object_type. Unfortunately, this means that you will still need to associate an object type (post type) to your taxonomy later in order to use it. register_taxonomy( ‘aprwc_rating_criteria’, null, $args ); From the documentation: Setting explicitly … Read more
I would go for custom nav menu walker… //define the custom post type and custom taxonomy define(“MENU_CPT”, “people”); define(“MENU_CT”, “club”); //custom function for selecting posts based on a term function get_posts_by_term($term_id, $post_type=MENU_CPT, $taxonomy=MENU_CT) { $args = array( ‘posts_per_page’ => -1, ‘post_type’ => $post_type, ‘tax_query’ => array( array( ‘taxonomy’ => $taxonomy, ‘field’ => ‘id’, ‘terms’ => … Read more
For a function that enqueues scripts, the action hook you use should actually be “wp_enqueue_scripts” for the front of the site, and “admin_enqueue_scripts” for the admin side of things. This is the proper time to enqueue scripts. While you can technically do it anytime before wp_head, this is the best place because it’s pretty much … Read more
Make it show_ui => false Then to show it on the post edit screen add the box manually add_action(‘add_meta_boxes’, ‘meta_boxes_function’); function meta_boxes_function() { add_meta_box(‘categoriesdiv’, ‘categories’, ‘post_categories_meta_box’, ‘blurb’, ‘side’, null, array(‘taxonomy’ => ‘categories’)); } use this code for every static term if(!term_exists(‘term1’, ‘categories’)) wp_insert_term(‘term1’, ‘categories’);
It’s a little complex, but you can add custom meta to taxonomies. http://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/ You could pretty easily integrate a WP media uploader field that would allow you to enter an image into the field.