Skip to main content
Used 'page_for_posts' instead
Source Link
MikeSchinkel
  • 37.5k
  • 14
  • 116
  • 132

I think you are looking for this:

// $page is a post where post_type=='page'
if (get_option('show_on_front')=='page') {
  $page_id = get_option('page_on_front''page_for_posts');
  $page = get_post($page_id);
} else {
  $page = false;
}

I think you are looking for this:

// $page is a post where post_type=='page'
if (get_option('show_on_front')=='page') {
  $page_id = get_option('page_on_front');
  $page = get_post($page_id);
} else {
  $page = false;
}

I think you are looking for this:

// $page is a post where post_type=='page'
if (get_option('show_on_front')=='page') {
  $page_id = get_option('page_for_posts');
  $page = get_post($page_id);
} else {
  $page = false;
}
Source Link
MikeSchinkel
  • 37.5k
  • 14
  • 116
  • 132

I think you are looking for this:

// $page is a post where post_type=='page'
if (get_option('show_on_front')=='page') {
  $page_id = get_option('page_on_front');
  $page = get_post($page_id);
} else {
  $page = false;
}