Problems displaying facebook share image using image parameter of share url - html

I am using the facebook share url but having trouble displaying the image parameter of the url, can anyone advise where I may be going wrong with this?
HTML
<a title="Share this on Facebook"
href="http://www.facebook.com/sharer.php?
s=100
&p[url]='http://www.test.com'
&p[images][0]='http://www.meandmrsjoneshotel.com/wp-content/themes/child-theme/img/fb-thumbs/home.png'
&p[title]='This is the title'
&p[summary]='This is the share description'"
target="_blank" class="fb ir">
Share this page on Facebook
</a>​
JS Fiddle http://jsfiddle.net/pUMZb/
Thanks

try to remove the apostrophes. Your code should be look like this
<a title="Share this on Facebook"
href="http://www.facebook.com/sharer.php?
s=100
&p[url]='http://www.test.com'
&p[images][0]=http://www.meandmrsjoneshotel.com/wp-content/themes/child-theme/img/fb-thumbs/home.png
&p[title]='This is the title'
&p[summary]='This is the share description'"
target="_blank" class="fb ir">
Share this page on Facebook
</a>​

Related

How to link to another bottom page?

This is my code
<a :href="page_4_state.data.dealerUrl" class="f-green" target="_blank">
<u>Searching for number</u>
Normally, It will link to another page.
But I want to link to the bottom of the another page.
I see your url dealer in the comment use a "href anchor", like this:
<a :href="page_4_state.data.dealerUrl+'#footer'" class="f-green" target="_blank">
<u>Searching for number</u>
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_a_href_anchor

whatsapp button sharing different url than actual

I have a working whatsapp <a> tag in this way:
<a class="whatsapp share-local-button
data-action="share/whatsapp/share"
target="_blank" href="whatsapp://send?text=link#withMark" >
<i class="fa fa-whatsapp"></i>
</a>
This works, but what is in href is simply the shared text, not the url, which is the current....
I tried with
data-href="link#withMark"
But no different results...
How can I share my customized url and not the current one?
Try adding something like a bit of PHP if you are able to. if you want to keep it clean html then just ignore this.
in php u define the link u want to set in a variable, then just add <?php $yourvariable ?> to the whatsapp://send?text= INSERT HERE
Add a JavaScript code as I did to dynamically add the link.
Also it is reusable and can be used in any page.
Here, we set the href of the element having class=whatsapp to it's href+ the site link.
Try running the code
document.getElementsByClassName('whatsapp')[0].href+=window.self.location;
<a class="whatsapp share-local-button
data-action="share/whatsapp/share"
target="_blank" href="whatsapp://send?text=">
<i class="fa fa-whatsapp">whatsapp</i>
</a>

Domain Masking - Youtube link will not work

I mask my domain name as I use my university free web hosting because I'm a poor student.
I have a link in my portfolio site to a Youtube video but it will not let me click on the link... the only way to open it is to right click and open in new window/tab.
How can I avoid this..?
The site is www.Grice95.co.uk and the link is in he far left 'CAMERA USE' icon.
Thanks Luke
You could try a hax like setting the href like this:
<a class="" href="https://www.youtube.com/v/_djf6rZ_0i4">
<img alt="" src="../images/large/cam-txtdriving.png">
<p>Text Driving - The Unwanted Outcomes (Intermediate)</p>
</a>
Or:
<a class="" href="https://www.youtube.com/watch?v=_djf6rZ_0i4&output=embed">
<img alt="" src="../images/large/cam-txtdriving.png">
<p>Text Driving - The Unwanted Outcomes (Intermediate)</p>
</a>
Or:
<a class="" href="https://www.youtube.com/embed/_djf6rZ_0i4">
<img alt="" src="../images/large/cam-txtdriving.png">
<p>Text Driving - The Unwanted Outcomes (Intermediate)</p>
</a>
The way around this is to get the iframe embed code and take the URL from there.
Taking this will redirect your youtube link to a full screen embed of your video that works whilst still retaining the masked url.
Thanks to 'thepio'

adding a link to a picture html

I've added a page link to a picture for my website, but it does not load the website because the link goes the directory therefore the webpages do not appear. My code is below:
<a href="www.w3schools.com">
<img src="Images/insta.png" alt="" style="width:7%; height:7%;">
</a>
When I click on the image it says file not found.
If you're linking to a page on an external site, you will need to provide the entire URL of the page in question, which includes the protocol. In this instance, that would be http://www.w3schools.com/.
By linking to www.w3schools.com, you are telling the browser to load that URL relative to the page you're linking from so, if this link were on a page located at http://domain.tld/page.html, clicking on it would attempt to load http://domain.tld/www.w3schools.com.
Add http:// OR https:// for your website link:
<a href="http://www.w3schools.com/">
<img src="Images/insta.png" alt="" style="width:7%; height:7%;">
</a>
<a href="http://www.w3schools.com" target="_blank">
<img src="Images/insta.png" alt="" style="width:7%; height:7%;">
</a>
Without the http:// your link will be something like: youraddress/www.w3schools.com
And pay attention if you image is in the correct folder called Images

Add Facebook Share button to static HTML page

Is there any way to add a Facebook Share Button to a static HTML page? I've implemented a simple web site with no server side, just a bunch of html pages and I was abble to add a Like button because it is implemented with iFrame element.
I have searched for a solution regarding the Share Button before posting here, but can't really find anything.
(Example of a share button can be seen on a youtube web site, on share section of each video.)
Any help is appreciated.
This should solve your problem: FB Share button/dialog documentation
Genereally speaking you can use either normal HTML code and style it with CSS, or you can use Javascript.
Here is an example:
<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fparse.com" target="_blank" rel="noopener">
<img class="YOUR_FB_CSS_STYLING_CLASS" src="img/YOUR_FB_ICON_IMAGE.png" width="22px" height="22px" alt="Share on Facebook">
</a>
Replace https%3A%2F%2Fparse.com, YOUR_FB_CSS_STYLING_CLASS and YOUR_FB_ICON_IMAGE.png with your own choices and you should be ok.
Note: For the sake of your users' security use the HTTPS link to FB, like in the a's href attribute.
You should be able to generate your own button code here: http://developers.facebook.com/docs/reference/plugins/like/
<a name='fb_share' type='button_count' href='http://www.facebook.com/sharer.php?appId={YOUR APP ID}&link=<?php the_permalink() ?>' rel='nofollow'>Share</a><script src='http://static.ak.fbcdn.net/connect.php/js/FB.Share' type='text/javascript'></script>
Replace <url> with your own link
<script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top left; }</style><a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" onclick="return fbs_click()" target="_blank" class="fb_share_link">Share on Facebook</a>
<div class="fb_share">
<a name="fb_share" type="box_count" share_url="<?php the_permalink() ?>"
href="http://www.facebook.com/sharer.php">Partilhar</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> </div> <?php } }
add_action('thesis_hook_byline_item','fb_share');
In a very simple way, you can achieve this
Facebook Share
*replace your_page_link.com with your desired URL or page link
Example
Facebook Share