Speed up your Oxygen workflow

with Swiss Knife Pro

A true Enhancer of Oxygens Builder Experience 
Lifetime Deal Only $40

Limit search to post type

If you need to display only certain post type ( page, post, custom post) you need to add this to function.php

function searchfilter($query) {
    if ($query->is_search && !is_admin() ) {
return $query;

On line 4 change what post type you need.

Source: https://www.wpbeginner.com/wp-tutorials/how-to-limit-search-results-for-specific-post-types-in-wordpress/

If you need help with custom scripts or you are not skilled enough to implement something from the tutorial?


Stay up to date with latest post and updates.