wp_query get data from advanced custom field in wordpress

Question

I want to get the data from advanced custom field using wp_query from another custom post type:

 $title = get_the_title();
 $the_query = new WP_Query( array(
    'posts_per_page'=>9,
    'post_type'=>'product_name',
    'order'   => 'ASC',
    'brand_name' => $title, /*brand_name is my custom field name*/
    'paged' => get_query_var('paged') ? get_query_var('paged') : 1) 
);

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/wp_query-get-data-from-advanced-custom-field-in-wordpress/">

wp_query get data from advanced custom field in wordpress</a>
0
, Sabbir 3 months 0 Answers 64 views 0

Leave an answer