Skip to content

Instantly share code, notes, and snippets.

@ekloff
Created December 22, 2012 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekloff/7ce118f8f4559f07d9f5 to your computer and use it in GitHub Desktop.
Save ekloff/7ce118f8f4559f07d9f5 to your computer and use it in GitHub Desktop.
add_action("pre_get_posts", "custom_front_page");
function custom_front_page($wp_query){
if($wp_query->get('page_id') == get_option('page_on_front')):
$wp_query->set('post_type', 'work');
$wp_query->set('page_id', ''); //Empty
//Fix conditional Fucntions like is_front_page or is_single ect
$wp_query->is_page = 0;
$wp_query->is_singular = 0;
endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment