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

Get terms from multiple taxonomies

If you want to retrieve multiple taxonomies you need to put the four taxonomies in an array, you are doing this, but you have put taxonomy=> in the array. $terms = get_terms( ‘taxonomy’ => array( ‘vehicle_safely_features’, ‘vehicle_exterior_features’, ‘vehicle_interior_features’, ‘vehicle_extras’) ); Hope it helps

How to add a style to taxonomy edit page

You can do it like this: add_action (‘admin_enqueue_scripts’, ‘wpse_style_tax’) ; function wpse_style_tax () { // these 3 globals are set during execution of {edit-tags,term}.php global $pagenow, $typenow, $taxnow ; if (!in_array ($pagenow, array (‘edit-tags.php’, ‘term.php’)) { return ; } if (‘news’ != $typenow) { return ; } if (‘news-category’ != $taxnow) { return ; } … Read more

Exclude Child Term Posts from Parent Term Archive

Okay, I’ve found an answer. Part of the issue was the missing array @goto10 mentioned, and the other part was that tax_query has required arguments. Here’s what I’m using so far: function exclude_children($wp_query) { if ( isset ( $wp_query->query_vars[‘custom_taxomony’] ) ) { $wp_query->set(‘tax_query’, array( array ( ‘taxonomy’ => ‘custom_taxonomy’, ‘field’ => ‘slug’, ‘terms’ => $wp_query->query_vars[‘custom_taxonomy’], … Read more

Custom hierarchal taxonomy loses interface hierarchy when selecting parent & children

This seems to be normal, it also happens for categories. The wp_terms_checklist(), which creates the checklist, has an argument checked_ontop, enabled by default. The metabox does not override this, so checked categories or custom terms always appear on top of the list. This does not affect their actual hierarchy, only how they are displayed there. … Read more

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