function genesis_do_post_title() { if ( ! is_home() && genesis_entry_header_hidden_on_current_page() ) { return; } $title = apply_filters( 'genesis_post_title_text', get_the_title() ); if ( '' === trim( $title ) ) { return; } // Link it, if necessary. if ( ! is_singular() && apply_filters( 'genesis_link_post_title', true ) ) { $title = genesis_markup( [ 'open' => '<a %s>', 'close' => '</a>', 'content' => $title, 'context' => 'entry-title-link', 'echo' => false, ] ); } // Wrap in H1 on singular pages. $wrap = is_singular() ? 'h1' : 'h2'; // Also, if HTML5 with semantic headings, wrap in H1. $wrap = genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap; // Wrap in H2 on static homepages if Primary Title H1 is set to title or description. if ( is_front_page() && ! is_home() && genesis_seo_active() && 'neither' !== genesis_get_seo_option( 'home_h1_on' ) ) { $wrap = 'h2'; } /** * Entry title wrapping element. * * The wrapping element for the entry title. * * @since 2.2.3 * * @param string $wrap The wrapping element (h1, h2, p, etc.). */ $wrap = apply_filters( 'genesis_entry_title_wrap', $wrap ); // Build the output. $output = genesis_markup( [ 'open' => "<{$wrap} %s>", 'close' => "</{$wrap}>", 'content' => $title, 'context' => 'entry-title', 'params' => [ 'wrap' => $wrap, ], 'echo' => false, ] ); echo apply_filters( 'genesis_post_title_output', $output, $wrap, $title ) . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- title output is left unescaped to accommodate trusted user input. See https://codex.wordpress.org/Function_Reference/the_title#Security_considerations. }