{"id":1218,"date":"2013-10-16T17:23:55","date_gmt":"2013-10-16T17:23:55","guid":{"rendered":"http:\/\/musilda.cz\/?p=1218"},"modified":"2013-10-16T17:23:55","modified_gmt":"2013-10-16T17:23:55","slug":"nastaveni-defaltniho-obrazku-pomoci-facebook-open-graph","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/nastaveni-defaltniho-obrazku-pomoci-facebook-open-graph\/","title":{"rendered":"Nastaven\u00ed defaultn\u00edho obr\u00e1zku pomoc\u00ed Facebook Open Graph"},"content":{"rendered":"\n
Sd\u00edl\u00edte \u010dl\u00e1nky na Facebooku a nev\u00edte, jak ovlivnit, aby se zobrazoval u p\u0159\u00edsp\u011bvku v\u00e1mi ur\u010den\u00fd obr\u00e1zek? Dne\u0161n\u00ed tip v\u00e1m uk\u00e1\u017ee, jak na to. Pomoc\u00ed pou\u017eit\u00ed Facebook Open Graph, kter\u00fd jednoduchou funkc\u00ed vlo\u017e\u00edme do wp_head.<\/p>\n\n\n\n\n\n\n\n
Funkce vlo\u017e\u00ed n\u011bkolik meta tag\u016f do hlavi\u010dky str\u00e1nky a ur\u010d\u00ed, zda se jedn\u00e1 o singular – tedy o str\u00e1nku, nebo \u010dl\u00e1nek a vlo\u017e\u00ed bu\u010f n\u00e1hledov\u00fd obr\u00e1zek, pokud existuje, nebo logo. Kategorie a arch\u00edv v\u011bt\u0161inou nesd\u00edl\u00edte, tak\u017ee se postar\u00e1me je\u0161t\u011b o hlavn\u00ed stranu, kde vyu\u017eijeme logo. Vy samoz\u0159ejm\u011b m\u016f\u017eete vyu\u017e\u00edt jak\u00fdkoliv obr\u00e1zek, kter\u00fd v\u00e1s m\u00e1 na Faceboku prezentovat.
M\u00edsto ADMIN_ID vlo\u017ete sv\u00e9 id a upravte si url k va\u0161emu logu.<\/p>\n\n\n\n
function custom_facebook_image() {\n echo '';\n echo '';\n echo '';\n global $post;\n if ( is_singular() ) {\n echo '';\n echo '';\n if (has_post_thumbnail( $post->ID )) {\n $feat_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );\n echo '';\n }else{\n echo '';\n }\n }\n if ( is_home() ) {\n echo '';\n echo '';\n echo '';\n }\n}\nadd_action( 'wp_head', 'custom_facebook_image' );\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Sd\u00edl\u00edte \u010dl\u00e1nky na Facebooku a nev\u00edte, jak ovlivnit, aby se zobrazoval u p\u0159\u00edsp\u011bvku v\u00e1mi ur\u010den\u00fd obr\u00e1zek? Dne\u0161n\u00ed tip v\u00e1m uk\u00e1\u017ee, jak na to. Pomoc\u00ed pou\u017eit\u00ed Facebook Open Graph, kter\u00fd jednoduchou funkc\u00ed vlo\u017e\u00edme do wp_head.<\/p>\n","protected":false},"author":1,"featured_media":8644,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,18],"tags":[272],"class_list":["post-1218","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-navody","category-shortcodes","tag-open-graph"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1218"}],"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=1218"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1218\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8644"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=1218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=1218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=1218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}