{"id":3421,"date":"2016-11-16T05:12:16","date_gmt":"2016-11-16T05:12:16","guid":{"rendered":"http:\/\/musilda.cz\/?p=3421"},"modified":"2016-11-16T05:12:16","modified_gmt":"2016-11-16T05:12:16","slug":"sablony-vlastni-druhy-obsahu-ve-wordpress-4-7","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/sablony-vlastni-druhy-obsahu-ve-wordpress-4-7\/","title":{"rendered":"\u0160ablony pro vlastn\u00ed druhy obsahu ve WordPress 4.7"},"content":{"rendered":"\n

\u0160ablony str\u00e1nek v\u0161ichni dob\u0159e zn\u00e1me. Kdy\u017e jsi koup\u00edte pr\u00e9miovou \u0161ablonu, jsou to r\u016fzn\u00e9 full width page, blog mansonry a podobn\u011b. Pomoc\u00ed nich se d\u00e1 velmi efektivn\u011b m\u011bnit vzhled p\u0159\u00edslu\u0161n\u00e9 str\u00e1nky a m\u016f\u017eete m\u00edt p\u0159edp\u0159ipraveno celou \u0159adu vzhled\u016f.<\/p>\n\n\n\n

Select pro v\u00fdb\u011br \u0161ablony najdete v prav\u00e9m sloupci, v metaboxu Atributy str\u00e1nky.<\/p>\n\n\n\n

Bohu\u017eel, \u0161ablony byly dostupn\u00e9 pouze pro str\u00e1nky. Pokud jste cht\u011bli podobn\u00fd postup pou\u017e\u00edt u \u010dl\u00e1nk\u016f, museli jste \u0161\u00e1hnout po pluginu.<\/p>\n\n\n\n

To se ale od WordPressu 4.7 m\u011bn\u00ed.<\/p>\n\n\n\n

Nov\u011b budete m\u00edt mo\u017enost definovat \u0161ablony, nejen pro \u010dl\u00e1nky, ale i pro vlastn\u00ed druhy obsahu. Co\u017e zahrnuje i r\u016fzn\u00e9 produkty, testimonials a podobn\u011b.<\/p>\n\n\n\n

Z\u00e1pis v souboru \u0161ablony str\u00e1nky do verze 4.7:<\/p>\n\n\n\n

\/*\nTemplate Name: Full width Page\n*\/<\/pre>\n\n\n\n

Z\u00e1pis v souboru \u0161ablony pro custom post types:<\/p>\n\n\n\n

\/*\nTemplate Name: Full width\u00a0Post\nTemplate Post Type: post\n*\/<\/pre>\n\n\n\n

Osobn\u011b si mysl\u00edm, \u017ee d\u00edky t\u011bmto \u0161ablon\u00e1m, bude mo\u017en\u00e9 je\u0161t\u011b v\u00edce upravit vzhled detail\u016f jednotliv\u00fdch druh\u016f obsah\u016f a u\u017eivatel dostane velmi jednoduchou mo\u017enost v\u00fdb\u011bru. M\u016f\u017eete nap\u0159\u00edklad definovat odli\u0161n\u00fd vzhled pro \u010dl\u00e1nky, ur\u010dit\u00e9 kategorie. Pro magaz\u00edny naprosto super.<\/p>\n\n\n\n

Zp\u011btn\u00e1 kompatibilita v podstat\u011b nen\u00ed. U star\u0161\u00edch verz\u00ed se \u0161ablony jednodu\u0161e vyp\u00ed\u0161\u00ed v metaboxu u str\u00e1nky. Nic v\u00edce.<\/p>\n\n\n\n

Pokud je budete cht\u00edt potla\u010dit pro star\u0161\u00ed verze, budete muset pou\u017e\u00edt filter theme_page_templates. Tento filter tak\u00e9 v nov\u00e9 verzi dostane dynamickou verzi theme_{post_type}_templates.<\/p>\n","protected":false},"excerpt":{"rendered":"

\u0160ablony str\u00e1nek v\u0161ichni dob\u0159e zn\u00e1me. Kdy\u017e jsi koup\u00edte pr\u00e9miovou \u0161ablonu, jsou to r\u016fzn\u00e9 full width page, blog mansonry a podobn\u011b. Pomoc\u00ed nich se d\u00e1 velmi efektivn\u011b m\u011bnit vzhled p\u0159\u00edslu\u0161n\u00e9 str\u00e1nky a m\u016f\u017eete m\u00edt p\u0159edp\u0159ipraveno celou \u0159adu vzhled\u016f. Select pro v\u00fdb\u011br \u0161ablony najdete v prav\u00e9m sloupci, v metaboxu Atributy str\u00e1nky. Bohu\u017eel, \u0161ablony byly dostupn\u00e9 pouze pro<\/p>\n","protected":false},"author":1,"featured_media":8647,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,30],"tags":[110,469],"class_list":["post-3421","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-novinky","category-wordpress","tag-custom-post-temlpates","tag-wordpress-4-7"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/3421"}],"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=3421"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/3421\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8647"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=3421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=3421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=3421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}