{"id":649,"date":"2013-06-17T18:12:02","date_gmt":"2013-06-17T18:12:02","guid":{"rendered":"http:\/\/musilda.cz\/?p=649"},"modified":"2013-06-17T18:12:02","modified_gmt":"2013-06-17T18:12:02","slug":"wordpress-query-generator","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/wordpress-query-generator\/","title":{"rendered":"WordPress query generator"},"content":{"rendered":"\n

Na r\u016fzn\u00fdch f\u00f3rech se st\u00e1le dokola opakuj\u00ed dotazy na to jak vypsat \u010dl\u00e1nky v r\u016fzn\u00e9m po\u0159ad\u00ed a podle r\u016fzn\u00fdch parametr\u016f. P\u0159esto\u017ee je v Codexu WP_Query velmi dob\u0159e pops\u00e1na, m\u016f\u017ee b\u00fdt \u010dten\u00ed dokumentace pro n\u011bkoho \u00fanavn\u00e9. Jako perfektn\u00ed pom\u016fcka pro ka\u017ed\u00e9ho, kdo nechce studovat mo\u017enosti funkce v Codexu, je tu perfektn\u00ed pom\u016fcka. <\/p>\n\n\n\n\n\n\n\n

Pomoc\u00ed WordPress query generatoru nastav\u00edte pot\u0159ebn\u00e9 parametry a na n\u011bkolik kliknut\u00ed m\u016f\u017eete vytvo\u0159it r\u016fzn\u00e9 queries. Pokud nen\u00ed WordPress v\u00e1\u0161 denn\u00ed chleba, usnadn\u00ed v\u00e1m tento n\u00e1stroj od Spruce interactive<\/a> pr\u00e1ci. P\u0159esto\u017ee pro pokro\u010dilej\u0161\u00ed dotazy nen\u00ed vhodn\u00fd (neobsahuje mo\u017enost zm\u011bnit post_type), je velk\u00fdm pomocn\u00edkem. V\u00fdsledn\u00fd k\u00f3d m\u016f\u017ee vypadat n\u00e1sledovn\u011b:<\/p>\n\n\n\n

$custom_query = new WP_Query(array(\n        'post_status' => 'publish',\n        'post_type' => 'post',\n        'order' => 'ASC',\n        'orderby' => 'none',\n        'posts_per_page' => '10',\n        'offset' => '1',\n        'paged' => (get_query_var('paged')) ? get_query_var('paged') : 1\n    ));\n<\/pre>\n\n\n\n

Tak nev\u00e1hejte a generujte<\/a>.
Pokud je to pro v\u00e1s p\u0159\u00ednosn\u00fd tip, napi\u0161te mi to do koment\u00e1\u0159e a v n\u011bkter\u00e9m z dal\u0161\u00edch \u010dl\u00e1nk\u016f p\u0159inesu dal\u0161\u00ed tip na WordPress gener\u00e1tor k\u00f3du.<\/p>\n\n\n\n

\"\"<\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"

Na r\u016fzn\u00fdch f\u00f3rech se st\u00e1le dokola opakuj\u00ed dotazy na to jak vypsat \u010dl\u00e1nky v r\u016fzn\u00e9m po\u0159ad\u00ed a podle r\u016fzn\u00fdch parametr\u016f. P\u0159esto\u017ee je v Codexu WP_Query velmi dob\u0159e pops\u00e1na, m\u016f\u017ee b\u00fdt \u010dten\u00ed dokumentace pro n\u011bkoho \u00fanavn\u00e9. Jako perfektn\u00ed pom\u016fcka pro ka\u017ed\u00e9ho, kdo nechce studovat mo\u017enosti funkce v Codexu, je tu perfektn\u00ed pom\u016fcka. <\/p>\n","protected":false},"author":1,"featured_media":650,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[507],"class_list":["post-649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-wordpress-query-generator"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/649"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=649"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/649\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/650"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}