{"id":218612,"date":"2022-10-15T10:49:00","date_gmt":"2022-10-15T07:49:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=218612"},"modified":"2022-08-08T21:05:18","modified_gmt":"2022-08-08T18:05:18","slug":"sozdajte-virtualnyj-fajl-v-wordpress-s-podderzhkoj-wordpress-multisite","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/ru\/sozdajte-virtualnyj-fajl-v-wordpress-s-podderzhkoj-wordpress-multisite\/","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 WordPress \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 WordPress Multisite"},"content":{"rendered":"\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c WordPress Multisite, \u0438 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0430\u0439\u0442 (\u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435) \u0438\u043c\u0435\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u0441\u0430\u0439\u0442\u0430. \u042f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u044d\u0442\u0438 \u043a\u0430\u0440\u0442\u044b \u0441\u0430\u0439\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u0432 <strong>\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b<\/strong> \u0432 WordPress.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0430 \u0437\u0430\u0442\u0435\u043c \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0435 \u0431\u044b\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0430\u0439\u0442 \u0432 \u0432\u0430\u0448\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435 WordPress Multisite.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438, \u0447\u0442\u043e\u0431\u044b WordPress \u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c URL-\u0430\u0434\u0440\u0435\u0441\u043e\u043c, \u0433\u0434\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448 \u0444\u0430\u0439\u043b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0441\u044f.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430 URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u0430\u0440\u0442\u044b \u0441\u0430\u0439\u0442\u0430: sitemap.xml \u0438 sitemap-fr.xml.<\/p>\n<pre><code>function wholesomecode_sitemap_rewrites() {\n    global $wp;\n    $wp-&gt;add_query_var( 'map' );\n\n    add_rewrite_rule( 'sitemap.xml$', 'index.php?map=sitemap', 'top' );\n    add_rewrite_rule( '^sitemap-fr.xml$', 'index.php?map=sitemap-fr', 'top' );\n}\nadd_action( 'init', 'wholesomecode_sitemap_rewrites', 99 );\n<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u00ab\u043a\u0430\u0440\u0442\u0430\u00bb, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u0430\u0440\u0442\u044b \u0441\u0430\u0439\u0442\u0430 \u0441 \u044d\u0442\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c.<\/p>\n<h2>\u041f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044e<\/h2>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u0441\u043a\u0430\u0436\u0435\u043c, \u0447\u0435\u0440\u0435\u0437 \u043f\u043b\u0430\u0433\u0438\u043d, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a Yoast SEO), WordPress \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0441\u0443\u044e \u0447\u0435\u0440\u0442\u0443 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0432\u0430\u0448\u0435\u0433\u043e URL-\u0430\u0434\u0440\u0435\u0441\u0430. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u044d\u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<pre><code>function wholesomecode_prevent_slash_on_map_variable( $redirect) {\n    if (get_query_var( 'map')) {\n        return false;\n    }\n    return $redirect;\n}\nadd_filter( 'redirect_canonical', 'wholesomecode_prevent_slash_on_map_variable' );\n<\/code><\/pre>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0430\u043c\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0446\u0435\u043f\u0438\u0442\u044c\u0441\u044f \u0437\u0430 <code>template_include<\/code>\u043a\u0440\u044e\u0447\u043e\u043a. \u0412\u043e\u0442 \u043e\u0447\u0435\u043d\u044c \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430\u0448\u0438 \u043a\u0430\u0440\u0442\u044b \u0441\u0430\u0439\u0442\u0430.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c.<\/p>\n<pre><code>function wholesomecode_sitemap_contents( $template) {\n    $map = get_query_var( 'map' );\n    if (! empty( $map)) {\n        header( 'Content-type: text\/xml' );\n        if ('sitemap' === $map) {\n            ?&gt;\n            &lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n            &lt;sitemapindex xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;\n                &lt;sitemap&gt;\n                    &lt;loc&gt;https:\n                &lt;\/sitemap&gt;\n            &lt;\/sitemapindex&gt;\n            &lt;?php\n        } elseif ('sitemap-fr' === $map) {\n            ?&gt;\n            &lt;sitemapindex xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;\n                &lt;sitemap&gt;\n                    &lt;loc&gt;https:\n                &lt;\/sitemap&gt;\n            &lt;\/sitemapindex&gt;\n            &lt;?php\n        }\n        die();\n    }\n    return $template;\n}\nadd_action( 'template_include', 'wholesomecode_sitemap_contents' );\n<\/code><\/pre>\n<h3>\u0411\u043e\u043d\u0443\u0441: \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u0441\u0432\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 URL<\/h3>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u044b\u043b \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u043d\u043e \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 URL-\u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438, \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0432 \u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u0444\u0430\u0439\u043b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u044b \u0441\u0430\u0439\u0442\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u00ab\u043a\u0430\u0440\u0442\u044b\u00bb \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0438\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u044b.<\/p>\n<pre><code>function wholesomecode_sitemap_from_file( $template) {\n    $map = get_query_var( 'map' );\n    if (! empty( $map)) {\n        if (! function_exists( 'get_home_path')) {\n            include_once ABSPATH. '\/wp-admin\/includes\/file.php';\n        }\n        header( 'Content-type: text\/xml' );\n        include get_home_path(). 'maps\/'. $map. '.xml';\n        die;\n    }\n    return $template;\n}\nadd_action( 'template_include', 'wholesomecode_sitemap_from_file' );\n<\/code><\/pre>\n<h2>\u0421\u0431\u0440\u043e\u0441 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u0432\u043e\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u2014 \u044d\u0442\u043e \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 <code>functions.php<\/code>, \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u2014 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 <code>Settings &gt; Permalinks<\/code>\u043f\u0430\u043d\u0435\u043b\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 WordPress \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043f\u043b\u0430\u0433\u0438\u043d, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0445\u0443\u043a\u0443 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438 \u043f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430:<\/p>\n<pre><code>register_activation_hook( __FILE__, 'flush_rewrite_rules' );\n<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/codex.wordpress.org\/Function_Reference\/flush_rewrite_rules\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445 \u0441\u0431\u0440\u043e\u0441\u0430 \u0432 \u041a\u043e\u0434\u0435\u043a\u0441\u0435 WordPress<\/a> \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e.<\/p>\n<p>\u041d\u0430\u0448\u0430 \u043a\u0430\u0440\u0442\u0430 \u0441\u0430\u0439\u0442\u0430 \u043d\u0430 \u0444\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435<\/p>\n<p>\u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043d\u043e \u0435\u0441\u043b\u0438 \u044f \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u0439\u0434\u0443 \u043d\u0430 \u0444\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0430\u0439\u0442\u0430 \u0438 \u043f\u043e\u0438\u0449\u0443 \u043a\u0430\u0440\u0442\u0443 \u0441\u0430\u0439\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <a href=\"https:\/\/mattwatson.codes\/fr\/sitemap.xml\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">mattwatson.codes\/fr\/sitemap.xml<\/a> ), \u044f \u0441\u043c\u043e\u0433\u0443 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043a\u0430\u0440\u0442\u044b \u0441\u0430\u0439\u0442\u0430. \u041d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.<\/p>\n<h2>\u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u043c\u0443\u043b\u044c\u0442\u0438\u0441\u0430\u0439\u0442\u0435 WordPress<\/h2>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445 WordPress Multisite \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435. \u0412\u0441\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c, \u044d\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0430\u0439\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0441\u044f.<\/p>\n<pre><code>function wholesomecode_sitemap_rewrites() {\n    global $wp;\n    $wp-&gt;add_query_var( 'map' );\n\n    if (get_current_blog_id() == '1') {\n        add_rewrite_rule( 'sitemap.xml$', 'index.php?map=sitemap', 'top' );\n    }\n\n    if (get_current_blog_id() === get_id_from_blogname( 'fr')) {\n        add_rewrite_rule( '^sitemap-fr.xml$', 'index.php?map=sitemap-fr', 'top' );\n    }\n}\nadd_action( 'init', 'wholesomecode_sitemap_rewrites', 99 );\n<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d \u043c\u0443\u043b\u044c\u0442\u0438\u0441\u0430\u0439\u0442 WordPress, \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, <code>get_current_blog_id<\/code>\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/wholesomecode.ltd\" class=\"external external_icon\">wholesomecode.ltd<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c WordPress Multisite, \u0438 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0430\u0439\u0442 (\u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435) \u0438\u043c\u0435\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u0441\u0430\u0439\u0442\u0430. \u042f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b&#8230;<\/p>\n","protected":false},"author":1,"featured_media":223984,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[809,726,850],"tags":[1171],"class_list":["post-218612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-ru","category-rozrobnyk-ru","category-uchebniki-ru","tag-affiai-ru"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/posts\/218612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/comments?post=218612"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/posts\/218612\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/media\/223984"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/media?parent=218612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/categories?post=218612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/ru\/wp-json\/wp\/v2\/tags?post=218612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}