custom post type taxonomy “tag” archive : no post found

Tag and Category archive queries default to querying only the post post type, to add your custom post type to those queries, you can use the pre_get_posts action: function wpa_cpt_tags( $query ) { if ( $query->is_tag() && $query->is_main_query() ) { $query->set( ‘post_type’, array( ‘post’, ‘object’ ) ); } } add_action( ‘pre_get_posts’, ‘wpa_cpt_tags’ );

Taxonomy dropdown metabox in the back-end

Here is an example. I have also created a Gist with more generic code. add_action(‘add_meta_boxes’, ‘my_custom_metabox’); function my_custom_metabox() { add_meta_box(‘custom-taxonomy-dropdown’,’Brands’,’taxonomy_dropdowns_box’,’post’,’side’,’high’); } function taxonomy_dropdowns_box( $post ) { wp_nonce_field(‘custom-dropdown’, ‘dropdown-nonce’); $terms = get_terms( ‘brands’, ‘hide_empty=0’); $object_terms = wp_get_object_terms( $post->ID, ‘brands’, array(‘fields’=>’ids’)); // you can move the below java script to admin_head ?> <script type=”text/javascript”> jQuery(document).ready(function() { jQuery(‘#custombrandoptions’).change(function() … Read more

Can you add the visual editor to the description field for custom taxonomies?

Just wrote the function. It’ll display the tinymce editor in every custom taxonomy description right now. Surely you can edit to show it for only some specific taxonomy. /** * Display advanced TinyMCE editor in taxonomy page */ function wpse_7156_enqueue_category() { global $pagenow, $current_screen; if( $pagenow == ‘edit-tags.php’ ) { require_once(ABSPATH . ‘wp-admin/includes/post.php’); require_once(ABSPATH . … Read more

Remove the category/taxonomy description field?

When no hook is available, you can always count on the old jQuery trickery… add_action( ‘admin_footer-edit-tags.php’, ‘wpse_56569_remove_cat_tag_description’ ); function wpse_56569_remove_cat_tag_description(){ global $current_screen; switch ( $current_screen->id ) { case ‘edit-category’: // WE ARE AT /wp-admin/edit-tags.php?taxonomy=category // OR AT /wp-admin/edit-tags.php?action=edit&taxonomy=category&tag_ID=1&post_type=post break; case ‘edit-post_tag’: // WE ARE AT /wp-admin/edit-tags.php?taxonomy=post_tag // OR AT /wp-admin/edit-tags.php?action=edit&taxonomy=post_tag&tag_ID=3&post_type=post break; } ?> <script type=”text/javascript”> … Read more

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