0

I'm setting up my own social share box, but I'm having trouble using the linkedin-share option. The content inside the link is passed in through php, but I think there's an error in my code

When I try to manually change the article url inside the share-url, it works fine, but my generated link won't work.

This is what i wrote inside my code:

mini=true&url=<?php echo $url;?>&title=<?php echo $title; ?>&summary=<?php echo $excerpt;?>&source=dfib.net"

and this is how it outputs in the browser:

https://www.linkedin.com/shareArticle/?mini=true&url=http://dfib-nieuw.test/attentia-jobsite/&title=Attentia%20jobsite&summary=Hoe%20kan%20je%20deze%20doelgroep%20beter%20aanspreken%20dan%20met%20een%20aantrekkelijke%20website%20die%20alle%20job-%20en%20carri%C3%A8re-info%20overzichtelijk%20weergeeft?&source=dfib.net

What am I doing wrong here?

1 Answers1

0

Look at the URL you are sharing:

...&url=http://dfib-nieuw.test....

.test is not a valid Top Level Domain, so you cannot test with that.

Typically, if you want to have a test URL, use example.com, for instance, this URL works perfectly for me...

https://www.linkedin.com/sharing/share-offsite/?url=http%3A%2F%2Fwww.revoltlib.com

Source: Official Microsoft Linkedin Share Plugin Documentation.

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133