👯♂️ Social Share Buttons
This is a Javascript code that can be used on any site with a Business or Commerce subscription plan.
When placed inside a code block, this code will display three buttons that allow a user to click the button and share a link to the individual page on the selected social media platform.
How to use this code
This code is designed to work on any page of your site where you can add a code block.
Pro Tip: This code is designed for Bluesky, Threads, and LinkedIn. Share this code with Custom Codey and ask them to add or remove specific platforms that you prefer.
<div class="custom-share-buttons">
<a id="share-bluesky" target="_blank">Share on Bluesky</a>
<a id="share-threads" target="_blank">Share on Threads</a>
<a id="share-linkedin" target="_blank">Share on LinkedIn</a>
</div>
<style>
.custom-share-buttons {
display: flex;
gap: 10px;
margin: 20px 0;
}
.custom-share-buttons a {
padding: 10px 15px;
background: #e5f5f6;
border-radius: 4px;
text-decoration: none;
font-weight: bold;
color: #333;
transition: background 0.3s ease;
}
.custom-share-buttons a:hover {
background: #ccc;
}
</style>
<script>
const pageUrl = encodeURIComponent(window.location.href);
const pageTitle = encodeURIComponent(document.title);
document.getElementById("share-bluesky").href = `https://bsky.app/intent/compose?text=${pageTitle}%20${pageUrl}`;
document.getElementById("share-threads").href = `https://www.threads.net/intent/post?text=${pageTitle}%20${pageUrl}`;
document.getElementById("share-linkedin").href = `https://www.linkedin.com/sharing/share-offsite/?url=${pageUrl}`;
</script>