• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Genesis Theme Framework a2z

Genesis Theme Framework a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / genesis_is_blog_template() – Determine if the Blog template is being used.

You appear to be a bot. Output may be restricted

Description

Determine if the Blog template is being used.

is_page_template() is not available within the loop or any loop that modifies $wp_query because it changes all the conditionals therein. Since the conditionals change, is_page() no longer returns true, thus is_page_template() will always return false.

Usage

$bool = genesis_is_blog_template();

Parameters

Returns

bool True if Blog template is being used, false otherwise.

Source

File name: genesis/lib/functions/general.php


Lines:

1 to 8 of 8
function genesis_is_blog_template() {

  global $wp_the_query;

  return 'page_blog.php' === get_post_meta( $wp_the_query->get_queried_object_id(), '_wp_page_template', true );

}
 

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: genesis_is_blog_template
Plugin ref: Genesis Framework
Version: 3.3.3
Sourcefile: lib/functions/general.php
File ref: lib/functions/general.php
Deprecated?: No
API Letters: B,G,I,T

Footer

Genesis a2z
Genesis Theme Framework a2z
WordPress Dynamic API Reference
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  genesis.wp-a2z.org
© Copyright Genesis a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites