Created
October 1, 2018 03:52
-
-
Save cameronjonesweb/ea7befc6e377d894f07b0ca5c40423b8 to your computer and use it in GitHub Desktop.
Adds the Yoast SEO webmaster tools (and other sites) verification codes to all pages including the login page. This is helpful when running a membership site or similar that requires users being logged in to view the site.
This file contains 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 | |
add_action( 'init', 'cameronjonesweb_yoast_front_page_head' ); | |
function cameronjonesweb_yoast_front_page_head() { | |
if ( class_exists( 'WPSEO_Frontend' ) ) { | |
add_action( 'wpseo_head', array( WPSEO_Frontend::get_instance(), 'webmaster_tools_authentication' ), 90 ); | |
add_action( 'login_head', array( WPSEO_Frontend::get_instance(), 'webmaster_tools_authentication' ), 90 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment