• 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 / Parsed Source / Parsed: 51330
function genesis_seo_site_title() {

  // Set what goes inside the wrapping tags.
  $inside = current_theme_supports( 'genesis-custom-logo' ) && has_custom_logo() ? wp_kses_post( get_bloginfo( 'name' ) ) : wp_kses_post( sprintf( '<a href="%s">%s</a>', trailingslashit( home_url() ), get_bloginfo( 'name' ) ) );

  // Determine which wrapping tags to use.
  $wrap = genesis_is_root_page() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';

  // Fallback for static homepage if an SEO plugin is active.
  $wrap = genesis_is_root_page() && genesis_seo_disabled() ? 'p' : $wrap;

  // Fallback for latest posts if an SEO plugin is active.
  $wrap = is_front_page() && is_home() && genesis_seo_disabled() ? 'h1' : $wrap;

  // And finally, $wrap in h1 if HTML5 & semantic headings enabled.
  $wrap = genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;

  
/**
 * Site title wrapping element
 *
 * The wrapping element for the site title.
 *
 * @since 2.2.3
 *
 * @param string $wrap The wrapping element (h1, h2, p, etc.).
 */
  $wrap = apply_filters( 'genesis_site_title_wrap', $wrap );

  // Build the title.
  $title = genesis_markup(
    [
      'open'    => sprintf( "<{$wrap} %s>", genesis_attr( 'site-title' ) ),
      'close'   => "</{$wrap}>",
      'content' => $inside,
      'context' => 'site-title',
      'echo'    => false,
      'params'  => [
        'wrap' => $wrap,
      ],
    ]
  );

  
/**
 * The SEO title filter
 *
 * Allows the entire SEO title to be filtered.
 *
 * @since ???
 *
 * @param string $title  The SEO title.
 * @param string $inside The inner portion of the SEO title.
 * @param string $wrap   The html element to wrap the title in.
 */
  $title = apply_filters( 'genesis_seo_title', $title, $inside, $wrap );

  echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- sanitize done prior to filter application
}
 

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

Primary Sidebar

Information

Source ref: genesis_seo_site_title() – Echo the site title into the header.
Parse count / Source file date: 1574704766
MD5 hash: 39bb3417c6a9212bfa93d0500128825d

Footer

Genesis a2z
Genesis Theme Framework a2z
WordPress Dynamic API Reference
WordPress 5.9.3
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-2022. All rights reserved.


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

  • Home
  • Blog
  • Sitemap
  • Sites