How do I create a simple link linked by links?

I am using the following twitter, facebook and google +, but the related one gives me an error dialog:

<a class="btn btn-default icon" href="javascript:void(0)" onclick="window.open( 'http://www.twitter.com/share?url=<?php the_permalink(); ?>', 'sharer', 'toolbar=0, status=0, width=626, height=436');return false;" title="Share on Twitter"><span class="character">a</span></a>

<a class="btn btn-default icon" href="javascript:void(0)" onclick="window.open( 'http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>', 'sharer', 'toolbar=0, status=0, width=626, height=436');return false;" title="Share on Facebook"><span class="character">b</span></a>

<a class="btn btn-default icon" href="javascript:void(0)" onclick="window.open( 'https://plus.google.com/share?url=<?php the_permalink(); ?>', 'sharer', 'toolbar=0, status=0, width=626, height=436');return false;" title="Share on Google+"><span class="character">c</span></a>

<a class="btn btn-default icon" href="javascript:void(0)" onclick="window.open( 'https://www.linkedin.com/share?url=<?php the_permalink(); ?>', 'sharer', 'toolbar=0, status=0, width=626, height=436');return false;" title="Share on Google+"><span class="character">j</span></a>

      

Mistake

There is no related style information in this XML file with this. The document tree is shown below.

<WSResponse>
  <responseInfo>FAILURE_NO_SUBMIT_ACTION</responseInfo> <responseMsg/>
  <jsonPayLoad/> 
</WSResponse>

      

Note

<?php the_permalink(); ?>

displays a link to the current page of the site which you can use on social networks.

+3


source to share


5 answers


I think the problem is that you are not doing this in the way that connected you to you. You should always refer to the API docs first. For example, below linkedin describes how you can create a Share plugin for your site.

Share plugin generator

and the generated code looks like this:

<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/Share" data-url="Your_URL_Here" data-counter="top"></script>

      

Also you can do it like this:

https://www.linkedin.com/shareArticle?mini=true&url=http://developer.linkedin.com&title=LinkedIn%20Developer%20Network&summary=My%20favorite%20developer%20program&source=LinkedIn

      



Link: Share on Linkedin

Your link will look like this:

https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=Some%20Title&summary=Some%20Summary&source=YourWebsiteName

      

Where mini-parameter is for: Required argument, which must always be: true

and Source: The URL of the source (like your site or app name) Please let me know if you still need to know how it will work for you.

And all parameters must be url encoded.

+5


source


Can you just change the onclick url of linkedin 'share? url = 'to' shareArticle? mini = true & 'i think it will help.



<a class="btn btn-default icon" href="javascript:void(0)" onclick="window.open( 'http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>', 'sharer', 'toolbar=0, status=0, width=626, height=436');return false;" title="Linkedin"><span class="character">j</span></a>

      

+3


source


You are better off using a linkeidn script or see what it generates exactly

<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/Share" data-url="<?php the_permalink(); ?>" data-counter="top"></script>

      

source: linkedin developper

+1


source


This script will be added at the top

<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang:en_US</script>

      

and if you want to use linkedin button in the popup you need to insert the following script in html.

<script type="IN/Share" data-url="http://linkedin.com">
            </script>

      

0


source


I got it working like this (very simple):

 <a target="_blank" title="Share on LinkedIn"
     href="http://www.linkedin.com/shareArticle?mini=true&url={{your-content-here.com}}">
 </a>

      

a new tab will open (at least in Chrome) and look like this:

enter image description here

In my case, this is a link to the URL of the Chrome Webstorm item. Because I would like to share my Chrome extension app on various social media sites.

0


source







All Articles