floriangoguillon
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Blask] Specific project type on front pageI found the solution adding the following code :
add_action( ‘pre_get_posts’, ‘my_pre_get_posts’ );
function my_pre_get_posts($query) {
if ($query->get(‘post_type’) === ‘nav_menu_item’) {
$query->set(‘tax_query’,”);
}
}Thanks again.
- This reply was modified 9 years, 3 months ago by floriangoguillon.
Forum: Themes and Templates
In reply to: [Blask] Specific project type on front pageThanks again for your help. Sorry I should have been more precise. The menu is missing only on the front page. This is not a new child theme by the way.
Your code seems to make my menu disappear on this particular page. The menu is back as soon as I try without it.
Could it be because of pre_get_posts interfering with the menus query ?
When I type “functions make my menu disappear” on Google, I can see similar cases but I have no knowledge about that so I can’t fix it.
Thanks for your time.
Forum: Themes and Templates
In reply to: [Blask] Specific project type on front pageThanks again for your help. Sorry I should have been more precise. The menu is missing only on the front page. This is not a new child theme by the way.
Your code seems to make my menu disappear on this particular page. The menu is back as soon as I try without it.
Could it be because of pre_get_posts interfering with the menus query ?
When I type “functions make my menu disappear” on Google, I can see similar cases but I have no knowledge about that so I can’t fix it.
Thanks for your time.
Forum: Themes and Templates
In reply to: [Blask] Specific project type on front pageThanks a lot!!!!! It works almost perfectly. Do you know why the menu disappears with your code ?