Search result page is forced to display with archive page template
-
Hi!
Thanks for such great plugin.
There is a filter “pre_get_posts” applying a multiple post types “post and mec-events”. Since we need to unify the search page into one template.
So I have add a “pre_get_posts” filter to restore the post type to “mec-events” only.But there is a filter “template_include” which force to load “archive-mec-events.php”.
Since we are working for a unified search page, I suggest that in parser.php line 143,
elseif(is_post_type_archive($PT) &&)
change to
elseif(is_post_type_archive($PT) && !is_search())
so that it only load the template when it is not a search page since is_search() detect by checking the ‘s’ query variable.Just a suggestion because if the search page is also forced a custom template, it might break the consistency of the website.
- The topic ‘Search result page is forced to display with archive page template’ is closed to new replies.