Where command Way In Custom Post Type
When making a sales page using wordpress you must use the Custom Post Type, if you are not very difficult to manage your content, but if you do not use floor also filter the data according to its a thaoir roof.
This article will guide you to filter the data as you want without any restrictions.
function filter_where($where = '')
{
$text = 'theme4u';
$where .= " AND (post_title like '%$text%' OR post_content like '%$text%')";
return $where;
}
The you placed dnan code this in the file functions.php then the you placed paragraph code follows into before loop in file which you want filter data
add_filter('posts_where', 'filter_where');
This code is used to perform a filtering function was declared at first, in the sense that the function will find articles that contain the word “theme4u” in the title or article content.
You can create multiple filter functions for many different cases, you replace the 2nd argument of function “add_fillter” to correct the name of the function that you declared earlier is just OK.
I wish you success!