{"id":2297,"date":"2014-12-28T19:30:16","date_gmt":"2014-12-28T19:30:16","guid":{"rendered":"http:\/\/musilda.cz\/?p=2297"},"modified":"2014-12-28T19:30:16","modified_gmt":"2014-12-28T19:30:16","slug":"funkce-the_date","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/funkce-the_date\/","title":{"rendered":"Funkce the_date"},"content":{"rendered":"\n

Funkce the_date, je dal\u0161\u00ed z funkc\u00ed, kterou mus\u00edte pou\u017e\u00edt uvnit\u0159 loopu a vrac\u00ed datum publikace aktu\u00e1ln\u00edho \u010dl\u00e1nku.<\/p>\n\n\n\n\n\n\n\n

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

the_date( $format, $before, $after, $echo );<\/pre>\n\n\n\n

Argumenty funkce:<\/p>\n\n\n\n

$format – definuje form\u00e1t data, kter\u00e9 je vr\u00e1ceno, viz. php funkce date<\/a>.
$before – definuje \u0159et\u011bzec p\u0159ed datem
$after – definuje \u0159et\u011bzec p\u0159ed datem
$echo – definuje, zda se datum rovnou vyp\u00ed\u0161e. Pokud jej nechcete vypsat, pou\u017eijte false.<\/p>\n\n\n\n

Mus\u00edte v\u0161ak uv\u00e9st v\u0161echny argumenty, tedy pou\u017eijete z\u00e1pis:<\/p>\n\n\n\n

$datum = the_date('','','',false);<\/pre>\n\n\n\n

Pro zobrazen\u00ed data, jako nadpisu, m\u016f\u017eete pou\u017e\u00edt:<\/p>\n\n\n\n

the_date('','<\/pre>\n\n\n\n

‚,‘<\/h3>\n\n\n\n
');<\/pre>\n\n\n\n

Pro \u00fapravu v\u00fdstupu, m\u016f\u017eete pou\u017e\u00edt filter „the_date“, kter\u00fd p\u0159ij\u00edm\u00e1 $format, $before, $after.<\/p>\n\n\n\n

Funkce the_date m\u00e1 nev\u00fdhodu v tom, \u017ee pokud je na str\u00e1nce v\u00edce \u010dl\u00e1nk\u016f, kter\u00e9 maj\u00ed stejn\u00e9 datum publikace, vrac\u00ed datum pouze u prvn\u00edho. Proto ji doporu\u010duji pou\u017e\u00edvat pouze na single str\u00e1nce.<\/p>\n","protected":false},"excerpt":{"rendered":"

Funkce the_date, je dal\u0161\u00ed z funkc\u00ed, kterou mus\u00edte pou\u017e\u00edt uvnit\u0159 loopu a vrac\u00ed datum publikace aktu\u00e1ln\u00edho \u010dl\u00e1nku.<\/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":[99,373],"class_list":["post-2297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-codex","category-post-funkce","tag-codex","tag-the_date"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2297"}],"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=2297"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2297\/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=2297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=2297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=2297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}