WP pre_get_posts Usage

, ,

Using pre_get_posts can be very useful for optimizing a query on a looped page.  It allows you to add limitations or custom post types to the main WP query allowing you to do what you have been doing in two steps into one single step.  Here is one example of how to add a custom post type to the blogs query loop.

 

Skills

Posted on

July 6, 2016

Submit a Comment

Your email address will not be published. Required fields are marked *