{"id":2309,"date":"2015-01-11T08:31:09","date_gmt":"2015-01-11T08:31:09","guid":{"rendered":"http:\/\/musilda.cz\/?p=2309"},"modified":"2015-01-11T08:31:09","modified_gmt":"2015-01-11T08:31:09","slug":"jak-ziskat-nejvyssi-rodicovskou-kategorii-ve-wordpress","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-ziskat-nejvyssi-rodicovskou-kategorii-ve-wordpress\/","title":{"rendered":"Jak z\u00edskat nejvy\u0161\u0161\u00ed rodi\u010dovskou kategorii ve WordPress"},"content":{"rendered":"
Dne\u0161n\u00ed snippet, \u0159e\u0161\u00ed probl\u00e9m z\u00edsk\u00e1n\u00ed nejvy\u0161\u0161\u00ed rodi\u010dovsk\u00e9 kategorie v hierarchii kategori\u00ed. Typicky v \u0161ablon\u011b, pot\u0159ebujete zobrazit \u010d\u00e1st obsahu pouze v p\u0159\u00edpad\u011b, \u017ee se jedn\u00e1 o v\u00fdpis ur\u010dit\u00e9 kategorie a jejich potomk\u016f.<\/p>\n
Konkr\u00e9tn\u00edm p\u0159\u00edkladem m\u016f\u017ee b\u00fdt v\u00fdpis recenz\u00ed.<\/p>\n
M\u00e1te kategorii recenze a v sidebaru chcete m\u00edt n\u011bjakou reklamu, kter\u00e1 se ke kategorii v\u00e1\u017ee. A samoz\u0159ejm\u011b, \u017ee pot\u0159ebujete, aby se reklama zobrazovala i v podkategori\u00edch.<\/p>\n
Proto pot\u0159ebujete z\u00edskat nejvy\u0161\u0161\u00ed nad\u0159azenou kategorii k aktu\u00e1ln\u00ed. Sta\u010d\u00ed pou\u017e\u00edt n\u00e1sleduj\u00edc\u00ed k\u00f3d:<\/p>\n
\n$par_cat_slug = get_category_parents($cat_id, false, '\/' ,true);\n$par_cat_slug = explode('\/',$par_cat_slug);\n$parent_category = get_category_by_slug($par_cat_slug[0]);\n$cat_id = $parent_category->term_id;\n<\/pre>\nPokud si dne\u0161n\u00ed snippet vlo\u017e\u00edte do funkce, m\u016f\u017eete podmi\u0148ovat zobrazov\u00e1n\u00ed, dle rodi\u010dovsk\u00e9 kategorie kdekoliv v \u0161ablon\u011b.<\/p>\n","protected":false},"excerpt":{"rendered":"
Dne\u0161n\u00ed snippet, \u0159e\u0161\u00ed probl\u00e9m z\u00edsk\u00e1n\u00ed nejvy\u0161\u0161\u00ed rodi\u010dovsk\u00e9 kategorie v hierarchii kategori\u00ed. Typicky v \u0161ablon\u011b, pot\u0159ebujete zobrazit \u010d\u00e1st obsahu pouze v p\u0159\u00edpad\u011b, \u017ee se jedn\u00e1 o v\u00fdpis ur\u010dit\u00e9 kategorie a jejich potomk\u016f.<\/p>\n","protected":false},"author":1,"featured_media":1484,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,30],"tags":[],"class_list":["post-2309","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippety","category-wordpress"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2309"}],"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=2309"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2309\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/1484"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=2309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=2309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=2309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}