Created
October 26, 2018 09:54
-
-
Save sebastienserre/b64de4e3213c796e55ee2df00bc884c9 to your computer and use it in GitHub Desktop.
Example of code to add a dynamic url for sitemaps in WP multisite / Multidomain
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
add_filter( 'robots_txt', 'thfo_add_sitemaps'); | |
function thfo_add_sitemaps( $output ){ | |
$sitemap_url = 'sitemap: ' . get_bloginfo('url') . '/sitemap.xml'; | |
$output .= $sitemap_url; | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment