Replace query_posts with pre_get_posts
Without seeing the broken code it is hard to say, but your filter should look something like this: function pregp_wpse_97354($qry) { if (is_front_page() && is_main_query() && is_user_logged_in()) { $qry->set(‘cat’,2); $qry->set(‘posts_per_page’,5); $qry->set(‘orderby’,’date’); $qry->set(‘order’,’DESC’); } } add_action(‘pre_get_posts’,’pregp_wpse_97354′); You mentioned something about the user being logged in, which your code does not check for, but I threw that … Read more