I have a frontpage which shows a different category of posts depending on whether a user is logged in or not.
using the following code in pre_get_posts()
function lg_set_category_filter($wp_query) {
if(is_front_page()) {
if (is_user_logged_in()) {
$wp_query->set('cat','6');
}
else {
$wp_query->set('cat','5');
}
}
}
Now, if I also display a custom menu widget on that page the menu is empty. It seems the query set is interfering with the custom menu widget.
How can I stop it removing custom menu entries?