With get_posts(), how can I put a category as a variable May 19, 2022 by Tarik Billa Have you tried the following code? $cat_posts = get_posts('numberposts=10&category='.$catID);