Custom search with TranslatePress
-
Hi,
I made a custom search to search on my custom post (docutheque).
It works for the default language (fr) when I search for a french term on the french version of the site, but it doesn’t in the secondary language (en).
When I search an english term on the english version, it returns no results.
If I search french term in the english version, it returns results in english.
Here is the code :
$keyword = sanitize_text_field( $_POST[‘keyword’] );
$args = array(
‘s’ => $keyword,
‘post_type’ => ‘docutheque’,
‘post_status’ => ‘publish’,
‘orderby’ => ‘publish_date’,
‘order’ => ‘DESC’,
‘posts_per_page’ => 6,
‘paged’ => 1,
);
$posts = new WP_Query( $args );Any Idea ?
- The topic ‘Custom search with TranslatePress’ is closed to new replies.