Nota: Sebbene le nostre guide più popolari siano state tradotte in italiano, alcune guide sono disponibili solo in inglese.
Adding a Facebook Like button

There are two ways to add a Facebook Like button to your site: You can display the Like button with your other Share buttons, or you can use this guide to add a custom Like button to pages and blog posts using the Code Block.

We recommend using our built-in Share button, but a code-based solution might be a good option if you have coding knowledge and want more control over where the button appears.

Note: The Facebook Like button won't post directly to the visitor's Facebook timeline, but may appear in their friends' News Feeds, depending on their feed and Facebook's algorithms.
Gli step in questa guida includono l'uso di Iniezione di codice e l'aggiunta di codice avanzato a un Blocco codice. Queste sono funzionalità Premium disponibili nei piani Business e Commerce.

Prima di iniziare

Facebook's custom Like button code isn't compatible with our built-in Facebook Share button. To avoid having an empty space in your Share button list, disable the Facebook Share button by following these steps:

  1. Nel Menu Home, clicca su Marketing e quindi sui Pulsanti Condividi.
  2. Uncheck Facebook before adding this code.

To learn more, visit Adding share buttons.

Step 1 - Create a Like button

To add a Facebook Like button to your site, you'll need to create the button using Facebook's developer tools. You can find those here.

In the URL to Like box, enter your Site URL or the URL of the page on your site you'd like the button to apply to.

In the Width box, enter the width you'd like your plugin to be in pixels. This will depend on the space of the area where you'd like your button to appear. Facebook automatically sets the height of the plugin.

Select a style from the Layout drop-down menu.

Then, select an Action Type from the Action Type drop-down menu.

Check Show Friends' Faces to display profile thumbnails when two or more friends like this post. Check Include Share Button to display a Share Button with the Like Button.

Click Get Code.

Step 2 - Add the Javascript SDK code

Copy the Javascript SDK code from the first box.

Open your Squarespace site in a new tab. In the Home Menu, click Settings, click Advanced, and then click Code Injection.

In Header box, paste the Javascript SDK code. Click Save.

Note: For more help with this panel, visit Using Code Injection.

Step 3 - Add the Like button code to a page

In Facebook's developer tools, copy the Like button code from the second box.

This code is used to add a Like button to a specific area of your site. You can add this to any content area using the Code Block.

Open the editor for the page or post where you'd like to add the Like button. Click an Insert Point and select Code from the Block Menu.

In the Code Editor, paste the Like button code. Click Save.

Nota: talvolta, come misura di sicurezza, il codice incorporato è disabilitato quando sei connesso. Se non vedi il codice, disconnettiti o visualizza la pagina utilizzando la modalità Privato / Incognito del browser. Per maggiori informazioni, visita Perché non riesco a vedere il codice personalizzato mentre sono connesso al mio sito?

Step 4 - Add post-specific Like buttons to blog posts (optional)

You can modify the code to display a unique Like button below each of your blog posts. When visitors click this Like button, it will like the specific blog post, rather than your site as a whole.

Nel riquadro Pagine , passa il mouse sopra un titolo della pagina blog e fai clic su gear-icon accanto al titolo per aprire le impostazioni di pagina.

Nella scheda Avanzate , incolla il codice del pulsante Mi piace di Facebook (dallo Step 3) nella casella Iniezione di codice elemento post.

Replace your site URL in the code with {permalink}.

Clicca su Save (Salva).

fb-like.png

The Facebook Like button will display directly after the content for each blog post.

Note: This third-party customization falls outside the scope of our support. This means that we’re unable to help further with setup or troubleshooting. Additionally, since this is a code-based solution, we can’t guarantee its functionality or full compatibility with Squarespace. This includes how it functions with our responsive design, particularly its appearance on mobile devices, and if it functions on all templates. Third-party customizations can also cause display issues with future updates to our platform. While we can't help further, there are many resources that can point you in the right direction:

To add a "Like on Facebook" option to your site without custom code, try Share buttons.

Questo articolo ti è stato utile?
Utenti che ritengono sia utile: 41 su 56
Adding a Facebook Like button