Query for custom post type

Posted by Prem Tiwari | Updated on

Query for custom post type. Use the pre_get_posts filter and just set the portfolio post type for the main query. Use Conditional Tags to determine where you want to have this filter.

Quick Example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers