Child Pages and Custom Taxonomies

You can grab the ID’s of all children and set the post__in argument for your tax query: $child_ids = $wpdb->get_col( “SELECT ID FROM $wpdb->posts WHERE post_parent = $post->ID AND post_type=”page” ORDER BY menu_order” ); $args = array( ‘post__in’ => $child_ids, // Only retrieve taxonomy posts that are children of this page ‘tax_query’ => array( array( … Read more

How do you move custom fields to custom taxonomies using WP Queries

I would recommend using WordPress function calls to set up your terms, instead of SQL. This is assuming you’ve already registered a custom taxonomy called job_listing_region. // Add this to your theme’s functions.php function convert_meta_to_term() { global $wpdb; $meta_query = $wpdb->get_results(” SELECT * FROM $wpdb->postmeta WHERE meta_key = ‘job_listing_region’ “); foreach ($meta_query as $meta) { … Read more

Index page of posts tagged with two separate taxonomies

This is very similar to this question. Try something like this in your template and change the AND condition to AND/OR as appropriate depending on what combination you want. $args = array( ‘post_type’ => ‘Book’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘Genre’, ‘field’ => ‘slug’, ‘terms’ => array( ‘Fiction’ ) ), array( … Read more

Taxonomy archive page have no post

your code seems to be correct. Here is the process to debug it: As your code is correct (what I can see), you need to update your htaccess. To perform it, go to the permalinks WP section and save again permalinks (keep your structure). If not working, you need to flush rewrite rules on your … Read more

WordPress taxonomy radio buttons

However, this will turn ALL terms checkboxes to radio buttons. Not only that, it’ll turn any checkbox in a meta box – not ideal! Instead, let’s specifically target the wp_terms_checklist() function, which is used to generate the list of checkboxes across the admin (including quick edit). /** * Use radio inputs instead of checkboxes for … Read more

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