How to query by custom post type values in WordPress? -



How to query by custom post type values in WordPress? -

i have custom post type using custom post type ui plugin called case studies. i'm using custom fields add together capability field case studies.

how can query case studies capability equal id?

$query = array('post_type' => 'case-studies','posts_per_page' => 3);

is query far

you need set key capability, , query value post id.

'meta_query' => array( array( 'key' => 'capability', 'value' => $post->id, 'compare' => 'example' ) )

custom-post-type wordpress

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -