Filter custom post type by custom taxomony

Ok, so the answer here is both annoying and fairly difficult to find/fix. The wp_dropdown_categories() function outputs the dropdown for each custom taxonomy filter using the term_id as the value for each option. However, when constructing the query the WP_Query::parse_tax_query() method, by default, sets the field element to slug. So, I had to make a … Read more

WP_Query a custom field value bringing back 0 results

UPDATE: Ok this should work, according to ACF’s documentation: $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘page’, ‘meta_query’ => array( array( ‘key’ => ‘feature_on_front_page’, ‘value’ => ‘featured’, ‘compare’ => ‘LIKE’ ), ) ); Your code works for me. Can you see the feature_on_front_page custom field when you view the page(s) in the WordPress admin … Read more

Add a custom variable to query page object

I updated my question with a partial answer to this problem. By adding an underscore ‘_’ before the name of the meta field it allows you to add meta data without it creating an editable custom field on the page edit screen. update_post_meta( get_queried_object()->ID, ‘_term_id’, $meta_term_id);

WordPress Query posts that have title > another title

You can use get_page_by_title to match the title of the required post. $post_name = get_page_by_title( ‘Post Title’ ); $vars = array( ‘name’ => $post_name, ‘paged’ => $page, ‘posts_per_page’ => intval($posts), ‘order’ => ‘asc’, ‘offset’ => ($offset ? $offset : ”), ‘orderby’ => ‘title’ );

Return on a quest all these meta_value

You need to use a meta query: if ( isset( $_REQUEST[‘src’] ) ) { $query = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( ), ); if ( isset( $_REQUEST[‘srcbusiness’] ) ) { $query[‘category_name’] = wp_unslash( $_REQUEST[‘srcbusiness’] ); } $fields = array( ‘srctype’, ‘srcprice’, ‘srccity’, ‘srcdistrict’, ); foreach ( $fields as $field ) { if ( … Read more

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