{"id":565,"date":"2013-06-07T04:00:44","date_gmt":"2013-06-07T04:00:44","guid":{"rendered":"http:\/\/musilda.cz\/?p=565"},"modified":"2013-06-07T04:00:44","modified_gmt":"2013-06-07T04:00:44","slug":"zjisteni-id-nadrazene-stranky-ve-wordpressu","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/zjisteni-id-nadrazene-stranky-ve-wordpressu\/","title":{"rendered":"Zji\u0161t\u011bn\u00ed ID nad\u0159azen\u00e9 str\u00e1nky ve WordPressu"},"content":{"rendered":"\n

N\u00e1sleduj\u00ed \u010d\u00e1st k\u00f3du jsem pou\u017eil, kdy\u017e bylo nutn\u00e9 p\u0159i\u0159adit odli\u0161n\u00e9 styly pro v\u0161echny str\u00e1nky, kter\u00e9 m\u011bli jako parrent jednu ur\u010ditou str\u00e1nku. \u0158ekn\u011bme, \u017ee m\u00e1te firemn\u00ed web, kde pro ur\u010dit\u00fd druh slu\u017eeb chcete m\u00edt jin\u00e9 pozad\u00ed. N\u00e1sleduj\u00edc\u00ed funkce vrac\u00ed id parrent str\u00e1nky, pokud existuje.<\/p>\n\n\n\n\n\n\n\n

function is_subpage() {\n    global $post;\n    if ( is_page() && $post->post_parent ) {\n        return $post->post_parent;\n    } else {\n        return false;\n    }\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

N\u00e1sleduj\u00ed \u010d\u00e1st k\u00f3du jsem pou\u017eil, kdy\u017e bylo nutn\u00e9 p\u0159i\u0159adit odli\u0161n\u00e9 styly pro v\u0161echny str\u00e1nky, kter\u00e9 m\u011bli jako parrent jednu ur\u010ditou str\u00e1nku. \u0158ekn\u011bme, \u017ee m\u00e1te firemn\u00ed web, kde pro ur\u010dit\u00fd druh slu\u017eeb chcete m\u00edt jin\u00e9 pozad\u00ed. N\u00e1sleduj\u00edc\u00ed funkce vrac\u00ed id parrent str\u00e1nky, pokud existuje.<\/p>\n","protected":false},"author":1,"featured_media":8624,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[275],"class_list":["post-565","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippety","tag-parrent-page-id"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/565"}],"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=565"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/565\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8624"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}