WordPress custom taxonomy description for each post?

sounds like a silly question but are you echo’ing it out? <?php echo term_description($term_id, $taxonomy); ?> otherwise you’ll need to get the current post’s terms (where my_term is your custom taxonomy): $terms = wp_get_post_terms( $post->ID, ‘my_term’ ) then get the description for the first term in ther array: echo term_description($terms[0]->term_id, ‘my_term’); I’ve not tested this … Read more

Formating the_terms() function output

While you can specify separators and such in the_terms() arguments, it assumes that you actually want links. You can discard unwanted HTML by using filter: add_filter(‘the_terms’, ‘no_terms_links’, 10, 2); function no_terms_links($term_list, $taxonomy) { if (‘type’ == $taxonomy) return wp_filter_nohtml_kses($term_list); return $term_list; } Or just use deeper get_the_terms() function and iterate through its return to build … Read more

Remove Category description textarea

/*remove term descriptions from post editor */ function wpse_hide_cat_descr() { ?> <style type=”text/css”> .term-description-wrap { display: none; } </style> <?php } add_action( ‘admin_head-term.php’, ‘wpse_hide_cat_descr’ ); add_action( ‘admin_head-edit-tags.php’, ‘wpse_hide_cat_descr’ ); If you need to target it to category editor only – in other words leave description for other taxonomies, then easiest will be to position the … Read more

SQL QUERY needed to get POST category (taxonomy) ? – MUST be SQL statement

You can try this SQL query for the taxonomy ‘mi_neighborhoods‘ and let’s take POST_ID = 1304 SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON (tt.term_id = t.term_id) INNER JOIN wp_term_relationships AS tr ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.taxonomy IN (‘mi_neighborhoods’) AND tr.object_id IN (1304) ORDER BY t.name ASC; In general … Read more

How do I filter posts by taxomony using AJAX

I figured it out! Here is the code I used: Add to functions.php: add_action( ‘wp_ajax_nopriv_load-filter2’, ‘prefix_load_term_posts’ ); add_action( ‘wp_ajax_load-filter2’, ‘prefix_load_term_posts’ ); function prefix_load_term_posts () { $term_id = $_POST[ ‘term’ ]; $args = array ( ‘term’ => $term_id, ‘posts_per_page’ => -1, ‘order’ => ‘DESC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘yourtaxonomyhere’, ‘field’ => ‘id’, ‘terms’ => … Read more

Admin Panel – Disable Moving Selected Terms To Top of Metabox

Try adding this in your functions.php file: // Let’s stop WordPress re-ordering my categories/taxonomies when I select them function stop_reordering_my_categories($args) { $args[‘checked_ontop’] = false; return $args; } // Let’s initiate it by hooking into the Terms Checklist arguments with our function above add_filter(‘wp_terms_checklist_args’,’stop_reordering_my_categories’);

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