How to completely disable a taxonomy archive on the frontend?

s_ha_dum’s answer didn’t work for me, but this did: /** * Completely disable term archives for this taxonomy. * @param string $taxonomy WordPress taxnomy name */ function kill_taxonomy_archive($taxonomy){ add_action(‘pre_get_posts’, function($qry) { if (is_admin()) return; if (is_tax($taxonomy)){ $qry->set_404(); } } ); }

Replace Taxomony Description Field with Visual/WYSIWYG Editor

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

Custom Taxonomy’s Label to change the text appearing in Appearance > Menu

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

How do I dynamically populate wp_nav_menu from a custom taxonomy?

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

Custom Taxonomy-specific JavaScript

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)