Genesis Framework Custom Search Template which includes the custom post type and forces the different layouts available in framework.
While working on one of the theme development project using Genesis Framework. The client requested a different type of search results layout which includes the CPT (Custom Post Type) .
Here is the Solution
In Genesis Child Theme, Create the search.php file and remove the Genesis Standard Loop and write your own custom loop which includes the CPT (Custom Post Type) in my project it was Article & Videos and display the end result as needed.
Final Result Look like below image.
STEP 1 : Create Custom Search Template
Create the file named search.php in child theme directory having the below code:
Forcing The Layout – Line number 10 to 20 contains code for all layout options available, current full-width template is enabled here.
Just un-comment the layout code that you would like to use.
Custom Post Type & Order – Line number 35 contains code for post types included in desired order for the search result.
Much More You can do with above template code
- Remove The Post Information – Line no 54
- Remove The Post Featured Image – Line no 57
- Remove The Post Content – Line no 60
- Remove Post Content Nav – Line no 63 & 64
- Modify The Content Limit – Line no 67
- Modify The Content Limit Read More Link – Line no 70
- Force Excerpt Content – Line no 73
- Modify The Excerpt Limit Read More Link – Line no 76
- Remove The Post Meta Information – Line no 82 to 84
- Remove The archive Pagination – Line no 87
Before doing anything mentioned in above list you should be aware of what you are doing.