I used to be questioning the place did the “0” got here from right here:
I’ve a question with a number of put up sort however once I tried to echo the worth from these put up sorts it provides ‘0’ to the worth. how will I repair this this is my code:
$args = array(
'post_type' =>array('complan_a','complan_b','complan_c'),
'posts_per_page' => -1,
'orderby' => array(
'date' =>'DESC',
'menu_order'=>'ASC',
/*Different params*/
),
'post_status' => array('publish','future'),
'paged' => $paged,
'title' => $username
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) :
whereas ( $the_query->have_posts() ) : $the_query->the_post();
$payin_id = get_the_ID();
$revenue = get_field('amount_profit',$payin_id);
$profit1 = get_field('complan_b_profit',$payin_id);
$profit2 = get_field('complan_c_profit',$payin_id);
<?php echo $revenue;?>
<?php echo $profit1;?>
<?php echo $profit2;?>