I have 20 posts on my page and each post has a custom field called is_feature_home. I have to fetch the post where is_feature_home checked.
I tried the below code but I am not getting the correct output
function getpagecompany(){
global $post;
$args = array(
'post_type' => 'company',
'post_status' => 'publish',
'posts_per_page' => 8,
'is_feature_home'=>1,
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$tid=$loop->ID;
print_r(the_title);
// print_r(post_content);
endwhile;
wp_reset_postdata();
}