Skip to content
WebMaster SEOWebMaster SEO
  • LOGIN
  • PREMIUM
  • LOGIN
  • PREMIUM
  • Home
  • Plugins WordPress
    • Plugins
      • ACF
      • AffiliateWP
      • Backup Plugins
      • Caching Plugins
    • Plugins
      • CodeCanyon
      • Premium Plugins
      • Yoast
      • SEO Plugins
    • Plugins
      • Soflyy
      • WPML
      • WPMU DEV
    • Plugins
      • WP Rich Snippets
      • WC Vendors
  • E-Commerce WordPress
    • E-Commerce
      • AutomateWoo
      • Dokan
      • Woocommerce
    • E-Commerce
      • WP Lab & WP-Lister
      • WPMU DEV
      • YITH WooCommerce
  • Themi WordPress
    • ThemeForest
  • BLOG
    • Trucchi
    • Hosting
    • Affiliazioni
    • Tools S.E.O.
    • ANALIZZA SITO
    • Marketing
    • SEO e-Books
Tips and tricks

Come ottimizzare l’anteprima sui social Facebook e Twitter senza plugin con WordPress

31
Dic

Quando condividete un articolo o un prodotto woocommerce con il vostro WordPress l’immagine è sbagliata?

L’anteprima non è corretto?

Se siete come me che non volete installare plugin sul vostro wordpress allora questa soluzione fa al caso vostro:

Per utilizzare questa funzionalità di wordpress occorrerà agire sul file HEADER.php del vostro thema.

Individuate il file nella cartella del vostro thema.

Fatene una copia.

Vi consiglio sempre di lavorare con themi CHILD

Nel vostro file dovete copiare e incollare il seguente codice all’interno del file <head>COPIARE IL CODICE QUI</head>

<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@TUO-ACCOUNT-TWITTER" />
<meta name="twitter:creator" content="@TUO-ACCOUNT-TWITTER" />
<meta property="fb:app_id" content="APP ID DI FACEBOOK" />
<meta property="fb:admins" content="FBADMIN" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
<meta property="og:locale" content="it_IT" />
<meta property="og:image:width" content="800" />
<meta property="og:image:height" content="800" />
<?php if (is_single()) { ?>
<meta property="og:url" content="<?php echo get_permalink(); ?>" />
<meta property="og:title" content="<?php echo get_the_title(); ?>" />
<meta property="og:description" content="<?php echo substr(strip_tags($post->post_content), 0, 170).' [...]';?>" />
<meta property="og:image" content="<?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { ?>

<?php $image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'post-thumbnail', true);
echo $image_url[0];  ?>
<?php
} else {
?>
<?php bloginfo('template_directory'); ?>/facebook.png<?php
} ?>" />
<?php } ?>
<?php if (is_home() && !is_paged() ) { ?>
<meta property="og:title" content="<?php bloginfo('name'); ?>" />
<meta property="og:url" content="<?php bloginfo('url'); ?>" />
<meta property="og:description" content="<?php bloginfo('description'); ?>" />
<meta property="og:image" content="<?php bloginfo('template_directory'); ?>/facebook.png" />
<?php } ?>
  • Affinche tutto funzioni dovrete creare un app su facebook
  • Dovrete conoscere il numero del vostro admin FB utilizzate questo tool
  • Cambiare l’account di twitter
  • Creare un immagine facebook.png e caricarla nella directory del thema

Le linee da cambiare sono

twitter:site=@VOSTRO_ACCOUNT_TWITTER

twitter:creator=@VOSTRO_ACCOUNT_TWITTER

fb:app_id VOSTRO NUMERO APP

fb:admins VOSTRO ID ADMIN

close

Non perderti questi consigli!

Non inviamo spam! Puoi saperne di più leggendo la nostra Informativa sulla privacy

Controlla la tua casella di posta o la cartella spam per confermare la tua iscrizione

WPMU DEV MarketPress

Articoli Correlati

Creare Child dei temi di wordpress

Come avrete imparato a vostre spese è sempre buona norma utilizzare un tema FIGLIO per

31
Dic
Gutenberg non funziona se heartbeat è disabilitato

Uno dei primi errori che ho avuto modo di testare è che Gutenberg non funziona

31
Dic
siteground
Velocizzare WordPress con la scelta dell’hosting? Semplice Siteground

Velocizzare WordPress con la scelta dell’hosting? Semplice Siteground Dopo anni di esperienze negative con hosting

31
Dic
55 Plugin Gratuiti WordPress indispensabili per ogni Webmaster

I Plugin WordPress indispensabili per ogni Webmaster I Plugin sono un elemento fondamentale per personalizzare

31
Dic
Come vendere i tuoi corsi on line con WordPress

Hai realizzato un corso in video? Hai realizzato delle lezioni e-learning? Vuoi vendere i tuoi

31
Dic
Tutti i vantaggi degli abbonamenti Amazon

Cos’è Amazon Prime? Con una tariffa annuale di € 19,99 i membri Amazon Prime possono:

31
Dic
Creare una Sitemap Google Gratis senza limitazioni

Ci sono svariati modi per ottenere una sitemap del vostro sito web. Tra i piu

31
Dic
Come postare in automatico articoli wordpress su facebook e twitter

Con NextScripts: Social Networks Auto-Poster possiamo soncronizzare i nostri post wordpress con Facebook e Twitter.

31
Dic
  • Contatti
  • Newsletter
  • Privacy GDPR
Copyright 2023 © WEBMASTER-SEO
  • Home
  • Plugins WordPress
    • Plugins
      • ACF
      • AffiliateWP
      • Backup Plugins
      • Caching Plugins
    • Plugins
      • CodeCanyon
      • Premium Plugins
      • Yoast
      • SEO Plugins
    • Plugins
      • Soflyy
      • WPML
      • WPMU DEV
    • Plugins
      • WP Rich Snippets
      • WC Vendors
  • E-Commerce WordPress
    • E-Commerce
      • AutomateWoo
      • Dokan
      • Woocommerce
    • E-Commerce
      • WP Lab & WP-Lister
      • WPMU DEV
      • YITH WooCommerce
  • Themi WordPress
    • ThemeForest
  • BLOG
    • Trucchi
    • Hosting
    • Affiliazioni
    • Tools S.E.O.
    • ANALIZZA SITO
    • Marketing
    • SEO e-Books
 
 
 
PREMIUM
Seleziona ciclo pagamento
ISCRIVITI
    Strength: Very Weak

    (Use Cropper to set image and
    use mouse scroller for zoom image.)

    Seleziona metodo pagamento
    How you want to pay?
    Sommario pagamento

    Il tuo piano selezionato : , Ammontare Piano :
    Totala pagamento:
     
     
     
     
    PREMIUM
    Seleziona ciclo pagamento
    ISCRIVITI
      Strength: Very Weak
      Seleziona metodo pagamento
      How you want to pay?
      Sommario pagamento

      Il tuo piano selezionato : , Ammontare Piano :
      Totala pagamento:
       
      Forgot Password
      Please enter your email address or username below.
       
      Please Login
      Lost Your Password
      Dont have account? SIGNUP