{"id":231187,"date":"2022-12-22T17:46:00","date_gmt":"2022-12-22T14:46:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=231187"},"modified":"2022-12-07T10:46:10","modified_gmt":"2022-12-07T07:46:10","slug":"specialna-rozbivka-na-storinki-wordpress","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/uk\/specialna-rozbivka-na-storinki-wordpress\/","title":{"rendered":"\u0421\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u0430 \u0440\u043e\u0437\u0431\u0438\u0432\u043a\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0438 WordPress"},"content":{"rendered":"<p>\u0412\u0437\u0430\u0433\u0430\u043b\u0456 \u043a\u0430\u0436\u0443\u0447\u0438, \u0449\u043e\u0440\u0430\u0437\u0443, \u043a\u043e\u043b\u0438 \u044f \u043f\u0440\u0430\u0446\u044e\u044e \u0437 \u0440\u043e\u0437\u0431\u0438\u0432\u043a\u043e\u044e \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0438 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457, \u0446\u0435 \u0440\u043e\u0431\u043b\u044e \u0448\u043b\u044f\u0445\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044f \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0442\u0443 \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e <a href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">WP_Query<\/a>, \u0430 \u043f\u043e\u0442\u0456\u043c \u0432\u0438\u043a\u043b\u0438\u043a\u0443 <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_reset_postdata\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">wp_reset_postdata()<\/a> \u0443 \u043a\u0456\u043d\u0446\u0456 <a href=\"https:\/\/developer.wordpress.org\/themes\/basics\/the-loop\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">The Loop<\/a>.<\/p>\n<p>\u042f \u0432\u0441\u0435 \u0449\u0435 \u0432\u0432\u0430\u0436\u0430\u044e, \u0449\u043e \u0446\u0435 \u043c\u0430\u0454 \u043c\u0456\u0441\u0446\u0435, \u0430\u043b\u0435 \u0454 \u043f\u0440\u043e\u0441\u0442\u0456\u0448\u0435 \u0440\u0456\u0448\u0435\u043d\u043d\u044f, \u044f\u043a\u0435 \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0443\u043a\u0430, \u044f\u043a\u0438\u0439 \u043d\u0430\u0434\u0430\u0454 WordPress.<\/p>\n<p>\u0417\u043e\u043a\u0440\u0435\u043c\u0430, \u044f \u0433\u043e\u0432\u043e\u0440\u044e \u043f\u0440\u043e \u0445\u0443\u043a <a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/pre_get_posts\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">pre_get_posts<\/a>. \u0423 \u0414\u043e\u0432\u0456\u0434\u043d\u0438\u043a\u0443 \u043f\u043e \u043a\u043e\u0434\u0443 \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0431\u0430\u0447\u0438\u0442\u0438, \u0449\u043e \u0446\u0435 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0442\u0430\u043a:<\/p>\n<blockquote>\n<p>\u0421\u043f\u0440\u0430\u0446\u044c\u043e\u0432\u0443\u0454 \u043f\u0456\u0441\u043b\u044f \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043e\u0431&#8217;\u0454\u043a\u0442\u0430 \u0437\u043c\u0456\u043d\u043d\u043e\u0457 \u0437\u0430\u043f\u0438\u0442\u0443, \u0430\u043b\u0435 \u0434\u043e \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0442\u0443.<\/p>\n<\/blockquote>\n<p>\u0406 \u043e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u0437\u0430\u043f\u0438\u0442 \u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0431\u0430\u0433\u0430\u0442\u043e \u0456\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0456\u0457, \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u0439\u043e\u0433\u043e, \u0449\u043e\u0431 \u0432\u0438\u0437\u043d\u0430\u0447\u0438\u0442\u0438, \u0447\u0438 \u0445\u043e\u0447\u0435\u043c\u043e \u043c\u0438 \u0437\u043c\u0456\u043d\u0438\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u0456 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0438 \u0434\u043b\u044f \u0440\u043e\u0431\u043e\u0442\u0438 \u0437 \u0440\u043e\u0437\u0431\u0438\u0442\u0442\u044f\u043c \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0438.<\/p>\n<p>\u041f\u0456\u0434 \u0446\u0438\u043c \u044f \u043c\u0430\u044e \u043d\u0430 \u0443\u0432\u0430\u0437\u0456, \u0449\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u043f\u0435\u0440\u0435\u0433\u043b\u044f\u043d\u0443\u0442\u0438 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u0456\u0441\u0442\u044c <strong>post_type \u0456 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f<\/strong> <strong>posts_per_page<\/strong>. \u0414\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 \u0446\u0435 \u0432 <a href=\"https:\/\/gist.github.com\/tommcfarlin\/1e69ad55ecdb13424a66253c7d7aa4df#file-00-pre-get-posts-php\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0442\u0430\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u0456\u0431<\/a> :<\/p>\n<pre><code>&lt;?php\n\nuse WP_Query;\n\nadd_action('pre_get_posts', __NAMESPACE__. 'customPostTypePagination');\n\/**\n * If we're on the 'acme-post-type' page, then adjusts pagination so there are only two posts per page. This will \n * affect pagination so we can use built-in pagination links to easily page through the content.\n *\n * @param WP_Query the instance of the query object that contains information to populate the template.\n *\n * @return WP_Query an unmodified version of the query object or a modified version if we're on the acme post-type.\n *\/\nfunction customPostTypePagination(WP_Query $query)\n{\n  if (isset($query-&gt;query['post_type']) &amp;&amp; 'acme-post-type' == $query-&gt;query['post_type']) {\n    $query-&gt;set('posts_per_page', 2);\n  }\n}<\/code><\/pre>\n<p>\u041d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0432\u0438\u0449\u0435 \u043a\u043e\u0434 \u043d\u0435 \u0454 \u043e\u0431\u2019\u0454\u043a\u0442\u043d\u043e-\u043e\u0440\u0456\u0454\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u043c (\u044f\u043a\u0431\u0438 \u0432\u0456\u043d \u0431\u0443\u0432, \u044f \u0431 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u0432 \u043f\u0435\u0440\u0435\u0434\u043f\u043b\u0430\u0442\u043d\u0438\u043a\u0430 \u0442\u0430 \u043a\u043b\u0430\u0441, \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u043b\u044c\u043d\u0438\u0439 \u0437\u0430 \u043e\u0431\u0440\u043e\u0431\u043a\u0443 \u043b\u043e\u0433\u0456\u043a\u0438 \u0443 \u0444\u0443\u043d\u043a\u0446\u0456\u0457), \u0430\u043b\u0435 \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0431\u0430\u0447\u0438\u0442\u0438, \u044f\u043a \u0439\u043e\u0433\u043e \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u0442\u0438 \u0432 \u043d\u0430\u0439\u043f\u0440\u043e\u0441\u0442\u0456\u0448\u0456\u0439 \u0444\u043e\u0440\u043c\u0456.<\/p>\n<p>\u041e\u0442\u0436\u0435, \u044f\u043a\u0449\u043e \u0432\u0438 \u043f\u0440\u0430\u0446\u044e\u0454\u0442\u0435 \u0437 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044c\u043a\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u0440\u043e\u0437\u0431\u0438\u0442\u0442\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0438 \u0439 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0435 \u043c\u0430\u0442\u0438 \u0441\u043f\u0440\u0430\u0432\u0443 \u0437 \u0440\u0456\u0437\u043d\u0438\u043c\u0438 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u043c\u0438 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0432\u043b\u0430\u0441\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0442\u0443, \u0446\u0435 \u043c\u043e\u0436\u0435 \u0432\u0438\u0440\u0456\u0448\u0438\u0442\u0438 \u0432\u0430\u0448\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">\u0414\u0436\u0435\u0440\u0435\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0443:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/tommcfarlin.com\" class=\"external external_icon\">tommcfarlin.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0426\u0435 \u043c\u043e\u0436\u0435 \u0441\u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438, \u044f\u043a\u0449\u043e \u0432\u0438 \u043f\u0440\u0430\u0446\u044e\u0454\u0442\u0435 \u0437\u0456 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u044e \u0440\u043e\u0437\u0431\u0438\u0432\u043a\u043e\u044e \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0438 \u0439 \u043d\u0435 \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u043c\u0430\u0442\u0438 \u0441\u043f\u0440\u0430\u0432\u0443 \u0437 \u0432\u043b\u0430\u0441\u043d\u0438\u043c \u0437\u0430\u043f\u0438\u0442\u043e\u043c.<\/p>\n","protected":false},"author":1,"featured_media":235807,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[869,839,902,725],"tags":[1174],"class_list":["post-231187","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-10","category-kerivnytstvo-dlia-pochatkivtsiv","category-kod-3","category-rozrobnyk","tag-affiai-uk"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/231187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/comments?post=231187"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/231187\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media\/235807"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media?parent=231187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/categories?post=231187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/tags?post=231187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}