One loop for sticky, one for all the rest – how, without specifying category? October 15, 2022 by Tarik Billa you can get the category ID of a category archive with: get_query_var('cat')