Created
February 4, 2017 10:16
-
-
Save FSahinn/c5ba33e5b3589b9952cfbf86ade14c00 to your computer and use it in GitHub Desktop.
Wordpress Arama Sonucunda Sadece Yazılar Çıksın
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Arama Filtresi (4Piksel) */ | |
function dpx_aramafiltre($query) { | |
if ($query->is_search) { | |
$query->set('post_type', 'post'); /* Buraya arama sonuçlarında çıkmasını istediğiniz yazı türünü yazabilirsiniz. Örnek: page ya da kendi yazı türünüz. */ | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','dpx_aramafiltre'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment