• Hi,
    I’m trying to get more posts from the current author for single.php to output thumbnails from their other posts. If I pass the number directly it works, but if I put the ID in a vairablea and put the variable into the args it stops working. Any

    <?php
      $curUserID = the_author_meta('ID');
      echo $curUserID;
     $argsmore = array('post_type' => 'base_project', 'author' => $curUserID);
      $more_query = new WP_Query( $argsmore );
    
      // The Loop
      if ( $more_query->have_posts() ) :
      while ( $more_query->have_posts() ) : $more_query->the_post();
        the_title();
      endwhile;
      endif;
    
      // Reset Post Data
      wp_reset_postdata();
    
      ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Cant pass Author ID using variable’ is closed to new replies.