Nós compartilhamos com vocês sobre como adicionar o botão Curtir do Facebook no WordPress. Depois, falamos sobre como adicionar o botão Enviar Facebook no WordPress. Normalmente, o Facebook é realmente inteligente em puxar os dados certos dos seus Posts quando são compartilhados no Facebook. No entanto, algumas vezes o Facebook não puxa a miniatura direito quando alguém clica em Curtir, as vezes não puxa o título da página direito, etc. Pois bem, neste artigo, vamos compartilhar como você pode Adicionar o Facebook Open Graph nos Temas do WordPress, o que irá resolver todos esses problemas.
Temos dois métodos. Um para os usuários que realmente querem lidar com códigos. O outro método é instalar um simples plugin.
Facebook Open Graph Meta for WordPress
Basta instalar e ativar um plugin: Facebook Open Graph Meta for WordPress. Em seguida, vá em Configurações > Facebook OG Meta.
Digite o seu ID do Facebook, o Nome do Site, a Imagem Padrão, e pronto.
Método de Código
Abra o arquivo functions.php do seu tema, e cole o seguinte código dentro das tags do PHP:
//Adicionando o Open Graph no Atributo Idioma (Language) function add_opengraph_doctype( $output ) { return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"'; } add_filter('language_attributes', 'add_opengraph_doctype'); //Add Open Graph Meta Info function insert_fb_in_head() { global $post; if ( !is_singular()) //se não for um post ou página return; echo '<meta property="fb:admins" content="SEU ID"/>'; echo '<meta property="og:title" content="' . get_the_title() . '"/>'; echo '<meta property="og:type" content="article"/>'; echo '<meta property="og:url" content="' . get_permalink() . '"/>'; echo '<meta property="og:site_name" content="NOME do SEU SITE vai AQUI"/>'; if(!has_post_thumbnail( $post->ID )) { //se o post não tiver uma imagem destacada, utilize a imagem padrão $default_image="https://seusite.com.br/imagem.jpg"; //substitua esta por uma imagem padão em seu servidor ou uma imagem em sua biblioteca de mídia echo '<meta property="og:image" content="' . $default_image . '"/>'; } else{ $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' ); echo '<meta property="og:image" content="' . esc_attr( $thumbnail_src[0] ) . '"/>'; } echo " "; } add_action( 'wp_head', 'insert_fb_in_head', 5 );
Nota: Lembre-se de alterar o nome do site onde diz “NOME do SEU SITE vai AQUI”. Também altere a URL da imagem padrão pela sua. Nós recomendamos colocar uma imagem com o logotipo, porque se seu post não tiver uma miniatura, então, ele puxe o logotipo do seu site. Estudos mostram que os posts compartilhados compartilhadas sem uma miniatura são menos eficazes do que aqueles com miniaturas. Também não se esqueça de adicionar o seu ID de usuário. Você pode encontrar o seu ID de usuário do Facebook, indo para esta URL: http://graph.facebook.com/asllanmaciel (Basta substituir asllanmaciel com seu próprio nome de usuário).
Lembre-se, se você não quiser lidar com os códigos, basta fazer download do plugin Facebook Open Graph Meta for WordPress. Há um painel de opções na aba Configurações, que permite que você faça as alterações.
Esperamos ter ajudado com essas informações sobre esta ferramenta do facebook. Deixe-nos saber, escreva um comentário abaixo.
47 respostas
Thanks for shening. I read many of your blog posts, cool, your blog is very good. https://accounts.binance.com/en/register-person?ref=P9L9FQKY
Wow, superb weblog structure! How lengthy have you ever been running a blog for?
you made blogging look easy. The whole look of your site is excellent, let alone the
content! You can see similar here sklep internetowy
No matter if some one searches for his necessary thing, therefore he/she desires to be available
that in detail, so that thing is maintained over here.
I saw similar here: Sklep online
Helpful information. Fortunate me I found your site accidentally, and
I’m surprised why this coincidence did not took place earlier!
I bookmarked it. I saw similar here: Sklep online
Good day! Do you know if they make any plugins to help with Search Engine Optimization? I’m
trying to get my blog to rank for some targeted keywords but I’m not seeing
very good success. If you know of any please share.
Thank you! You can read similar article here: Sklep
It’s very interesting! If you need help, look here: ARA Agency
Write more, thats all I have to say. Literally,
it seems as though you relied on the video to make your point.
You obviously know what youre talking about,
why throw away your intelligence on just posting videos to your
blog when you could be giving us something enlightening to read?
Also visit my webpage vpn coupon 2024
You’re so awesome! I don’t suppose I’ve read something like this before.
So wonderful to discover someone with original thoughts on this
subject matter. Seriously.. thank you for starting this up.
This website is one thing that is required on the internet,
someone with a little originality!
My web-site: vpn coupon code 2024
indian pharmacy paypal http://indiaph24.store/# pharmacy website india
top 10 online pharmacy in india
buying from online mexican pharmacy: Online Pharmacies in Mexico – reputable mexican pharmacies online
indian pharmacy online [url=https://indiaph24.store/#]buy medicines from India[/url] indianpharmacy com
purple pharmacy mexico price list: buying from online mexican pharmacy – reputable mexican pharmacies online
Online medicine order http://indiaph24.store/# world pharmacy india
top 10 pharmacies in india
http://mexicoph24.life/# buying prescription drugs in mexico online
Misoprostol 200 mg buy online: buy misoprostol over the counter – buy cytotec
http://nolvadex.life/# tamoxifen and antidepressants
https://nolvadex.life/# tamoxifen 20 mg
buy generic ciprofloxacin: ciprofloxacin order online – ciprofloxacin over the counter
https://ciprofloxacin.tech/# buy cipro online without prescription
http://finasteride.store/# propecia without insurance
Abortion pills online [url=https://cytotec.club/#]cytotec buy online usa[/url] buy misoprostol over the counter
cytotec abortion pill [url=http://cytotec.club/#]cytotec online[/url] buy misoprostol over the counter
http://nolvadex.life/# tamoxifen depression
order generic propecia: order generic propecia without prescription – cost propecia without a prescription
cytotec online [url=http://cytotec.club/#]cytotec buy online usa[/url] cytotec online
https://ciprofloxacin.tech/# buy cipro cheap
http://cytotec.club/# Misoprostol 200 mg buy online
buying generic propecia pills [url=https://finasteride.store/#]get generic propecia price[/url] cost cheap propecia price
п»їcytotec pills online [url=https://cytotec.club/#]buy misoprostol over the counter[/url] Cytotec 200mcg price
http://nolvadex.life/# liquid tamoxifen
buy lisinopril 40 mg online: lisinopril 10 india – order lisinopril 10 mg
cytotec buy online usa [url=http://cytotec.club/#]cytotec online[/url] cytotec pills buy online
http://cytotec.club/# buy cytotec over the counter
tamoxifen and grapefruit: tamoxifen moa – nolvadex estrogen blocker
https://lisinopril.network/# lisinopril 2.5 mg
https://cytotec.club/# cytotec abortion pill
no prescription lisinopril [url=https://lisinopril.network/#]zestril 10mg price[/url] buying lisinopril online
http://ciprofloxacin.tech/# buy generic ciprofloxacin
tamoxifen estrogen: tamoxifen breast cancer prevention – aromatase inhibitors tamoxifen
Cytotec 200mcg price [url=https://cytotec.club/#]п»їcytotec pills online[/url] п»їcytotec pills online
https://lisinopril.network/# 2 lisinopril
cost of lisinopril 10 mg: medication lisinopril 5 mg – 10mg generic 10mg lisinopril
buy cytotec [url=http://cytotec.club/#]cytotec buy online usa[/url] Misoprostol 200 mg buy online
https://cytotec.club/# cytotec buy online usa
http://lisinopril.network/# lisinopril 10mg prices compare
nolvadex steroids: is nolvadex legal – tamoxifen and ovarian cancer
http://lisinopril.network/# lisinopril 2.5 mg coupon
ciprofloxacin order online [url=http://ciprofloxacin.tech/#]п»їcipro generic[/url] where can i buy cipro online
rx drug lisinopril [url=http://lisinopril.network/#]lisinopril 5 mg uk price[/url] lisinopril 25
http://finasteride.store/# cost of generic propecia for sale
lisinopril buy in canada: lisinopril 40 coupon – generic zestril