In my search page, My query returns 11 pages with this search: ?q=2&s=chem
But when I try to access another page other than the first, like ?q=2&s=chem&paged=2
for example, WordPress shows error not found
.
Note: If I leave empty s variable in URL, I have no problem.
This is my WP_Query
:
$args = array(
'number' => $number,
'offset' => $paged ? ($paged - 1) * $number : 0,
's' => $_GET['s'],
'meta_query' => array(
'relation' => 'OR',
[
'key' => 'comp_name',
'value' => $_GET['s'],
'compare' => 'LIKE'
]
),);
Someone knows how to fix this problem?