javascript - Fully custom social media share links and share count

726

I want to produce something like this on my site (without plugins)

<ul>
    <li class="count">1,034 shares</li>
    <li class="twitter"><a href="...">Twitter</li>
    <li class="facebook"><a href="...">Facebook</li>->
    <li class="google"><a href="...">Google+</li>
</ul>

In the end it will be a little more jazzed up than that.

So, I’m looking for ways to hand-code all the parts in PHP/Javascript.

  • Retrieve individual share counts and add them
  • Assemble the right format for the share links

The developer pages for Google, Facebook and Twitter only really help with the standard share link buttons. What I want is FULL control over the link and count number.

Basically, I want them to be available to me in PHP as individual variables.

People are also looking for solutions to the problem: Opening new window with JavaScript (predetermined size and width) via PHP echo command

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.