{"id":1209,"date":"2013-10-08T17:18:51","date_gmt":"2013-10-08T17:18:51","guid":{"rendered":"http:\/\/musilda.cz\/?p=1209"},"modified":"2013-10-08T17:18:51","modified_gmt":"2013-10-08T17:18:51","slug":"funkce-get_adjacent_post","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/funkce-get_adjacent_post\/","title":{"rendered":"Funkce get_adjacent_post"},"content":{"rendered":"

Funkce get_adjacent_post vrac\u00ed dal\u0161\u00ed, nebo p\u0159edchoz\u00ed post. V p\u0159ekladu to znamen\u00e1 p\u0159ilehl\u00fd, tedy post, kter\u00fd je ve v\u00fdpise hned dal\u0161\u00ed, nebo p\u0159edchoz\u00ed. M\u016f\u017eete definovat, zda p\u016fjde o post ve stejn\u00e9 kategorii, nebo ur\u010dit, kter\u00e9 kategorie se do soupisu zahrnou.<\/p>\n

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

 <\/p>\n

\nget_adjacent_post( $in_same_cat, $excluded_categories, $previous )\n<\/pre>\n

Parametry:<\/h2>\n

$in_same_cat – Ur\u010duje, zda bude post ve stejn\u00e9 kategorii, defaultn\u011b je false.<\/p>\n

$excluded_categories – definuje, z kter\u00fdch kategori\u00ed se bude \u0159adit dal\u0161\u00ed post, vkl\u00e1daj\u00ed se id kategori\u00ed a defaultn\u011b je “<\/p>\n

$previous – ur\u010duje, zda se bude jednat o p\u0159edchoz\u00ed post, defaultn\u011b je tedy true<\/p>\n

Funkce vrac\u00ed object, na hodnoty se tedy odkazuje nap\u0159\u00edklad $post->ID.<\/p>\n

P\u0159\u00edklad:<\/h2>\n
\n\n\n\n    <a href="ID)?>\">« Previous post<\/a>\n\n\n\n    <a href="ID)?>\">Next post »<\/a>\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

Funkce get_adjacent_post vrac\u00ed dal\u0161\u00ed, nebo p\u0159edchoz\u00ed post. V p\u0159ekladu to znamen\u00e1 p\u0159ilehl\u00fd, tedy post, kter\u00fd je ve v\u00fdpise hned dal\u0161\u00ed, nebo p\u0159edchoz\u00ed. M\u016f\u017eete definovat, zda p\u016fjde o post ve stejn\u00e9 kategorii, nebo ur\u010dit, kter\u00e9 kategorie se do soupisu zahrnou.<\/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":[167],"class_list":["post-1209","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-codex","category-post-funkce","tag-get_adjacent_post"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1209"}],"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=1209"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1209\/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=1209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=1209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=1209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}