{"id":1304,"date":"2013-11-21T07:09:18","date_gmt":"2013-11-21T07:09:18","guid":{"rendered":"http:\/\/musilda.cz\/?p=1304"},"modified":"2013-11-21T07:09:18","modified_gmt":"2013-11-21T07:09:18","slug":"funkce-get_extended","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/funkce-get_extended\/","title":{"rendered":"Funkce get_extended"},"content":{"rendered":"

Funkce get_extended rozd\u011bl\u00ed obsah \u010dl\u00e1nku na \u010d\u00e1st p\u0159ed a po tagu <!–more–>. Pokud tedy chcete vypsat jen zbytek \u010dl\u00e1nku, m\u016f\u017eete k tomu pou\u017e\u00edt tuto funkci.<\/p>\n

Pokud \u010dl\u00e1nek tag <!–more–> neobsahuje, funkce vr\u00e1t\u00ed zp\u00e1tky cel\u00fd obsah \u010dl\u00e1nku. Dok\u00e1\u017ei p\u0159edstavit situaci, kdy chcete zobrazit pro n\u00e1v\u0161t\u011bvn\u00edky jen perex \u010dl\u00e1nku a zbytek \u010dl\u00e1nku jen pro p\u0159ihl\u00e1\u0161en\u00e9 u\u017eivatele. Pomoc\u00ed podm\u00ednky a t\u00e9to funkce toho jednodu\u0161e dos\u00e1hnete.<\/p>\n

Pou\u017eit\u00ed:<\/h3>\n

 <\/p>\n

\n$display = get_extended(\u00a0$post_content );\n\necho $display['extended'];\n\n<\/pre>\n

Funkce p\u0159ij\u00edm\u00e1 obsah \u010dl\u00e1nku, v single.php to m\u016f\u017ee b\u00fdt t\u0159eba $post_content = get_the_content($post->ID) a vrac\u00ed pole s hodnotami main a extended, kde main je prvn\u00ed \u010d\u00e1st \u010dl\u00e1nku a extended je druh\u00e1 \u010d\u00e1st \u010dl\u00e1nku.<\/p>\n

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

Funkce get_extended rozd\u011bl\u00ed obsah \u010dl\u00e1nku na \u010d\u00e1st p\u0159ed a po tagu <!–more–>. Pokud tedy chcete vypsat jen zbytek \u010dl\u00e1nku, m\u016f\u017eete k tomu pou\u017e\u00edt tuto funkci. Pokud \u010dl\u00e1nek tag <!–more–> neobsahuje, funkce vr\u00e1t\u00ed zp\u00e1tky cel\u00fd obsah \u010dl\u00e1nku. Dok\u00e1\u017ei p\u0159edstavit situaci, kdy chcete zobrazit pro n\u00e1v\u0161t\u011bvn\u00edky jen perex \u010dl\u00e1nku a zbytek \u010dl\u00e1nku jen pro p\u0159ihl\u00e1\u0161en\u00e9 u\u017eivatele. Pomoc\u00ed<\/p>\n","protected":false},"author":1,"featured_media":8523,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,15],"tags":[],"class_list":["post-1304","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-codex","category-post-funkce"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1304"}],"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=1304"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1304\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8523"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=1304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=1304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=1304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}