Created
December 13, 2018 21:25
-
-
Save moxdev/bc090d380a346443038cac8180284e60 to your computer and use it in GitHub Desktop.
Allowed tags for H1 page title in Wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function slug_page_titles() { | |
if(function_exists('get_field')) { | |
if($on_page_title) { ?> | |
<header class="entry-header"> | |
<h1 class="entry-title"> | |
<?php echo wp_kses( | |
$on_page_title, | |
array( | |
'span' => array(), | |
'em' => array(), | |
'strong' => array(), | |
'br' => array(), | |
) | |
); | |
?> | |
</h1> | |
</header><!-- .entry-header --> | |
<?php } else { ?> | |
<header class="entry-header"> | |
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> | |
</header><!-- .entry-header --> | |
<?php } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment