wordpress - Can you use pre_get_posts outside of the main query? -
i'm new wordpress , have been learning lot pre_get_posts lately. understand basic concept getting tripped on part of documentation. from codex : "similarly, pre_get_posts not work if used in template files (e.g., archive.php) , since called after query has been completed." if can't use in template files, mean it's on index.php? if that's case, why there example further down page pre_get_posts used change how archive displays? i understand power of pre_get_posts (over query_posts especially) i'm having hard time finding how can used many times on 1 site. see shows being used once , main loop. any guidance appreciated. files archive.php , category.php wordpress calls template files . documentation says, page templates have high level of specificity. explain why query initialized before template files being called , therefore, pre_get_posts miss it's point on template files. you able show archive without template files archive...