top of page

Social Share Buttons for Wix Dynamic Pages

Social Share Buttons for Wix Dynamic Pages

Wixideas

Apr 2, 2024

9

Tags:

Database filter, Frontend, Database, Our practice, development, Social, Coding, Dynamic page, Wix practice, Dataset, CMS, Our Practice, VELO, Web design skill

This Wix Social Share tutorial shows you how to add custom elements that allow you to share your website with top social media platforms.


There's no doubt that some of your site visitors may want to engage their friends and families with your content, and that's where social sharing comes in.


There are several benefits of having a social share button on your website, including:


  1. Increased visibility: Social share buttons make it easy for visitors to share your content on their social media platforms. This can increase the visibility of your content and attract new visitors to your website.

  2. Improved engagement: When visitors share your content on social media, it can lead to increased engagement with your brand. Social shares can generate likes, comments, and shares, all of which can help to build a sense of community around your brand.

  3. Enhanced credibility: When visitors see that others are sharing your content on social media, it can enhance your credibility and authority in your industry.

  4. Increased website traffic: Social shares can drive traffic to your website. As more people share your content on social media, it can lead to a snowball effect of increased traffic to your website.

  5. Improved search engine ranking: Social shares can also help to improve your search engine ranking. Google takes social signals into account when determining search rankings, so having social shares can help boost your visibility on search engines.


In terms of Wix Ideas, here are some tips for adding social share buttons to your Wix website:


  1. Customize your buttons: With Wix, you can customize your social share buttons to match your website's branding and design.

  2. Add buttons to specific pages: Consider adding social share buttons to specific pages on your website, such as blog posts or product pages, to encourage visitors to share that content.

  3. Monitor your results: Keep an eye on how many social shares your website is generating and which platforms are most popular. This can help you to optimize your social share button strategy over time.


Copy the code below:


import wixLocation from 'wix-location';

import wixWindow from 'wix-window';


$w.onReady(function () {


let siteUrl = wixLocation.url;

$w("#facebookShare").link = `https://www.facebook.com/sharer.php?u=${siteUrl}`; $w("#twitterShare").link = `https://twitter.com/intent/tweet?url=${siteUrl}`;

$w("#pinterestShare").link = `http://pinterest.com/pin/create/button/?url=${siteUrl}`; $w("#linkedInShare").link = `https://www.linkedin.com/sharing/share-offsite/?url=${siteUrl}`;


//TRIGGER URL BOX

$w("#urlTrigger").onClick(() => {


$w("#urlBox").collapsed ? $w("#urlBox").expand() : $w("#urlBox").collapse(); });


//ADD URL TO BUTTON LABEL

$w("#urlButton").label = siteUrl;

//COPY TO CLIPBOARD


$w("#urlButton").onClick(() => {

wixWindow.copyToClipboard(siteUrl).then(() => {

$w("#urlButton").label = `Recipe URL copied!`


setTimeout(() => {

$w("#urlButton").label = siteUrl;

}, 1000);

})

})

});



Related videos

Wix ideas.jpg
VBlog - Video Blog
Jun 28, 2024

60

Figma to Wix Studio Plugin Explained

Wix ideas.jpg
The Wix Wiz
Jul 1, 2024

27

Does the Figma to Wix Studio plugin work

Wix ideas.jpg
The Wx Wiz
Jun 18, 2024

25

How to Connect ANY Payment Provider

bottom of page