Support

Account

Home Forums Front-end Issues There's a 0 adding to the value on multiple post type

Unread

There's a 0 adding to the value on multiple post type

  • I was wondering where did the “0” came from here: (see screenshot)

    https://prnt.sc/IHQGtKGx0Ywv

    I have a query with multiple post type but when I tried to echo the value from those post types it adds ‘0’ to the value. how will I fix this here’s my code:

     <?php $args = array(
        'post_type' =>array('complan_a','complan_b','complan_c'),
        'posts_per_page' => -1,
         'orderby'   => array(
              'date' =>'DESC',
              'menu_order'=>'ASC',
              /*Other params*/
             ),
        'post_status' => array('publish','future'),
        'paged' => $paged,
        'title' =>  $username
       
    
    );
    $the_query = new WP_Query( $args );
    
     
      if ( $the_query->have_posts() ) :
            while ( $the_query->have_posts() ) : $the_query->the_post();
    
                $payin_id   = get_the_ID();
         $profit = get_field('amount_profit',$payin_id);
         $profit1 = get_field('complan_b_profit',$payin_id);
         $profit2 = get_field('complan_c_profit',$payin_id);
        
        <?php echo $profit;?>
        <?php echo $profit1;?>
         <?php echo $profit2;?>
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.