I use a custom post type called “produs”.
To be displayed on the first page, the following code was added in function.php:
add_action(‘pre_get_posts’, ‘filtreaza_interogarea_posturilor’);
function filtreaza_interogarea_posturilor($query) {
if (!is_admin() && !is_preview() && !$query->is_search && is_home()) {
$query->query_vars[‘post_type’] = array(‘post’, ‘produs’);
}
}
As a result, the menu on the front page is distorted, showing all “produs” type posts. Only on the front page.