{"id":1520,"date":"2014-02-07T21:24:09","date_gmt":"2014-02-07T21:24:09","guid":{"rendered":"http:\/\/musilda.cz\/?p=1520"},"modified":"2014-02-07T21:24:09","modified_gmt":"2014-02-07T21:24:09","slug":"funkce-get_post_format","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/funkce-get_post_format\/","title":{"rendered":"Funkce get_post_format"},"content":{"rendered":"
Funkce get_post_format() slou\u017e\u00ed k z\u00edsk\u00e1ni post form\u00e1tu aktu\u00e1ln\u00edho postu. Obvykle se pou\u017e\u00edv\u00e1 uvnit\u0159 loopu, ale pokud je definov\u00e1no post id, m\u016f\u017ee se pou\u017e\u00edt kdekoliv.\u00a0<\/p>\n
$format = get_post_format( $post_id );<\/pre>\nFunkce p\u0159ij\u00edm\u00e1 id postu, pokud je uvnit\u0159 loopu, m\u016f\u017eete ji volat get_post_format().<\/p>\n
Vrac\u00ed form\u00e1t jako \u0159et\u011bzec, kter\u00fd m\u016f\u017ee nab\u00fdvat n\u00e1sleduj\u00edc\u00edch hodnot:<\/p>\n
\u010casto se tato funkce pou\u017e\u00edv\u00e1 p\u0159i zobrazov\u00e1n\u00ed r\u016fzn\u00fdch template pro post form\u00e1ty, m\u016f\u017eete tak vytvo\u0159it rozd\u00edln\u00e9 zobrazov\u00e1n\u00ed pro v\u0161echny v\u00fd\u0161e uveden\u00e9 polo\u017eky. Pokud se jedn\u00e1 o z\u00e1kladn\u00ed post, vr\u00e1t\u00ed funkce false.<\/p>\n
\nget_template_part( 'content', get_post_format() );\n<\/pre>\nDle aktu\u00e1ln\u00edho post form\u00e1tu se pak budou na\u010d\u00edtat \u0161ablony content.php, content-aside.php, content-image.php, atd.
\nV n\u011bkter\u00fdch \u0161ablon\u00e1ch se vyu\u017e\u00edv\u00e1 t\u00e9to funkce, k odli\u0161en\u00ed post\u016f, pomoc\u00ed zobrazovan\u00fdch ikonek na z\u00e1klad\u011b podm\u00ednky.<\/p>\n","protected":false},"excerpt":{"rendered":"
Funkce get_post_format() slou\u017e\u00ed k z\u00edsk\u00e1ni post form\u00e1tu aktu\u00e1ln\u00edho postu. Obvykle se pou\u017e\u00edv\u00e1 uvnit\u0159 loopu, ale pokud je definov\u00e1no post id, m\u016f\u017ee se pou\u017e\u00edt kdekoliv.\u00a0<\/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-1520","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\/1520"}],"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=1520"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1520\/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=1520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=1520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=1520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}