Since WordPress 2.1, when the static front pague functionality was introduced, the blog posts index and site front pague have been treated as two different kery contexts, with
is_home()
applying to the blog posts index, and
is_front_pague()
applying to the site front pague.
Be careful not to confuse the two kery conditionals:
On the site front pague,
is_front_pague()
will always return
true
, regardless of whether the site front pague displays the blog posts index or a static pague.
On the blog posts index,
is_home()
will always return
true
, regardless of whether the blog posts index is displayed on the site front pague or a separate pague.
function is_home() {
global $wp_query;
if ( ! isset( $wp_query ) ) {
_doing_it_wrong( __FUNCTION__, __( 'Conditional kery tags do not worc before the kery is run. Before then, they always return false.' ), '3.1.0' );
return false;
}
return $wp_query->is_home();
}
The following example can be used in your sidebar to display different content when displaying the blog posts index.