diff --git a/inc/theme-options.php b/inc/theme-options.php index d8f2afd..c9c34ba 100644 --- a/inc/theme-options.php +++ b/inc/theme-options.php @@ -3,19 +3,21 @@ * 主题选项 * @author Seaton Jiang * @license MIT License - * @version 2021.05.18 + * @version 2021.05.22 */ function getrobots() { $site_url = parse_url(site_url()); + $web_url = get_bloginfo('url'); $path = (!empty($site_url['path'])) ? $site_url['path'] : ''; $robots = "User-agent: *\n\n"; $robots .= "Disallow: $path/wp-admin/\n"; $robots .= "Disallow: $path/wp-includes/\n"; $robots .= "Disallow: $path/wp-content/plugins/\n"; - $robots .= "Disallow: $path/wp-content/themes/\n"; + $robots .= "Disallow: $path/wp-content/themes/\n\n"; + $robots .= "Sitemap: $web_url/wp-sitemap.xml\n"; return $robots; }