Funkce get_next_post je dal\u0161\u00ed z jednodu\u0161\u0161\u00edch funkc\u00ed, kter\u00e9 se mohou zd\u00e1t v podstat\u011b zbyte\u010dn\u00e9, ale d\u00e1 se v n\u011bkter\u00fdch p\u0159\u00edpadech v\u00fdhodn\u011b vyu\u017e\u00edt. U WordPressu se mi l\u00edb\u00ed, jak jsou funkce hezky p\u0159irozen\u011b pojmenovan\u00e9 a tak z n\u00e1zvu je z\u0159ejm\u00e9, \u017ee funkce vrac\u00ed n\u00e1sleduj\u00ed \u010dl\u00e1nek.<\/p>\n
D\u00edky t\u00e9to funkci m\u016f\u017eete zobrazovat odkazy, nebo anotace na dal\u0161\u00ed \u010dl\u00e1nky v kategorii, nebo kategori\u00edch. V kombinaci s get_previous_post a parametry funkc\u00ed, m\u016f\u017eete vytvo\u0159it str\u00e1nkov\u00e1n\u00ed s anotacemi \u010dl\u00e1nk\u016f.<\/p>\n
Pou\u017eit\u00ed:<\/strong><\/p>\n
\nget_next_post( $in_same_cat, $excluded_categories );\n<\/pre>\nParametry:<\/strong><\/p>\n
$in_same_cat – Vr\u00e1tit n\u00e1sleduj\u00edc\u00ed \u010dl\u00e1nek ve stejn\u00e9 kategorii. Defaultn\u011b je false, pokud zad\u00e1te get_next_post(true);, bude n\u00e1sleduj\u00edc\u00ed \u010dl\u00e1nek ze stejn\u00e9 kategorie.<\/p>\n
$excluded_categories – Vylou\u010dit kategorie. Id ka\u017ed\u00e9 kategorie, kterou nechcete zobrazit. Pokud tento parametr pou\u017eijete, nesm\u00edte zapomenout doplnit $in_same_cat na false – get_next_post(false,45) zobraz\u00ed dal\u0161\u00ed \u010dl\u00e1nek, ale vynech\u00e1 \u010dl\u00e1nek z kategorie 45.<\/p>\n
P\u0159\u00edklad:<\/strong><\/p>\n
\n\n <a href="ID ); ?>\">post_title; ?><\/a>\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Funkce get_next_post je dal\u0161\u00ed z jednodu\u0161\u0161\u00edch funkc\u00ed, kter\u00e9 se mohou zd\u00e1t v podstat\u011b zbyte\u010dn\u00e9, ale d\u00e1 se v n\u011bkter\u00fdch p\u0159\u00edpadech v\u00fdhodn\u011b vyu\u017e\u00edt. U WordPressu se mi l\u00edb\u00ed, jak jsou funkce hezky p\u0159irozen\u011b pojmenovan\u00e9 a tak z n\u00e1zvu je z\u0159ejm\u00e9, \u017ee funkce vrac\u00ed n\u00e1sleduj\u00ed \u010dl\u00e1nek. D\u00edky t\u00e9to funkci m\u016f\u017eete zobrazovat odkazy, nebo anotace na dal\u0161\u00ed \u010dl\u00e1nky<\/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":[172],"class_list":["post-1313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-codex","category-post-funkce","tag-get_next_post"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1313"}],"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=1313"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1313\/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=1313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=1313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=1313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}