I use this plugin : http://wordpress.org/support/plugin/more-fields/page/2
How use WP_QUERY for this inputs ?!
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI use this plugin : http://wordpress.org/support/plugin/more-fields/page/2
How use WP_QUERY for this inputs ?!
More fields Plugin is to enter additional input into the post, page etc. And that is Custom Fields in WordPress.
To use WP_Query()
for those Custom Fields input, you have to query for the meta_key.
<?php
//Query for only my custom field value
$args = array(
'meta_key' => 'your_field_key'
);
$wpse_query = new WP_Query($args);
while( $wpse_query->have_posts() ):
$wpse_query->the_post();
if( get_post_meta( $post->ID, 'your_field_key', true ) != '' ):
echo get_post_meta( $post->ID, 'your_field_key', true );
endwhile;
?>
Learn more from Codex: WP_Query()
- Custom Field Parameters.
More related answers can be found HERE.
Additionally, More Fields plugin is not actively maintained, so it's not fit for updated WordPress. Better use other plugins like: Advanced Custom Fields, or the like.
if()
before the echo
. If the answer satisfy your need, don't forget to upvote it and mark the answer as accepted. We guys work here for reputation. :)
Dec 6, 2013 at 15:48