Why Facebook like and send button is not getting the correct url - Wordpress - wordpress

in my website http://youmark.it/ I have in the home page post and in all other single post pages the same number of like, also the send button once you click is showing the Facebook Page url and not the Post url.
I have integrated all stuff for open graph, if you look at the source code it seems to be ok but still doesn't work after few changes I did. Also in the Facebook Debug tool everything shows correct.
Does Facebook need time to get updated or am I doing something wrong?

You have all your like buttons “pointing” to the base URL of your website.
If you want them to like the individual article, then include the URL to that article in the href parameter of the <fb:like> tag.

Try to like this url: <?php the_permalink() ?> instead?
<iframe src="//www.facebook.com/plugins/like.php?href=<?php the_permalink() ?>&send=...
???

Related

Creating new oEmbed video provider / oEmbed displays in Wordpress posts but not in the editor

We are creating a service which hosts videos. Users upload videos to our website, and we provide embed codes for playback on their websites.
We have a number of users currently using Wordpress, so we figured we would create an oEmbed service to let users easily copy/paste links into their posts.
We followed a tutorial, and and registered the following provider in wordpress via wp_oembed_add_provider in functions.php
wp_oembed_add_provider('https://vectorly.io/*', 'https://vectorly.io/wordpress/embed');
We set up an oEmbed service endpoint (https://vectorly.io/wordpress/embed?url=....), which returns the following json
{
"version":"1.0",
"type":"video",
"provider_name":"Vectorly",
"provider_url":"https://vectorly.io/",
"width":"600",
"height":"340",
"thumbnail_width":"600",
"thumbnail_height":"340",
"thumbnail_url":"https://s3-us-west-2.amazonaws.com/m.cdpn.io/screenshot-coming-soon-small.png",
"title":"NVP DemoDay - Vectorly",
"html":"<iframe src=\"https://api.vectorly.io/embed/demo/ba37b243-46c4-4f60-9a12-f6885b95c661\" width=\"600\" height=\"340\" frameborder=\"0\" allowfullscreen />"
}
Embedly seems to validate the output
Copying and pasting one of our links (https://vectorly.io/watch/ba37b243-46c4-4f60-9a12-f6885b95c661) into the Wordpress post editor does seem to successfully grab the oembed details
But the embed content editor block doesn't show a preview of the video
The actual published post looks fine though
It seems that the preview block is loading the iframe properly, but is just setting the width and height as 0 during the preview.
Looking at other non-whitelisted oembed providers, this issue doesn't seem to come up, so I think I'm doing something wrong, but I can't figure out for the life of me what it is.
Mucking around in various Wordpress files, I think that other oEmbed links (even from non-whitelisted 3rd parties) are doing something to trigger sizing of the preview Iframe in Javascript.
Any insight on this would be appreciated. Otherwise, we'll just forego oEmbed and stick with vanilla html embed codes
In case anyone else stumbles on this issue in the future:
You need to provide iframe close tags when you send oembed responses to wordpress
I.E. The following does not work
<iframe src="..." />
The following does work
<iframe src="..." ></iframe>
Adding a figure tag improves the result. See the fixed oEmbed output from our server
{
"version":"1.0",
"type":"video",
"provider_name":"Vectorly",
"provider_url":"https://vectorly.io/",
"width":"600",
"height":"338",
"thumbnail_width":"600",
"thumbnail_height":"338",
"thumbnail_url":"https://s3-us-west-2.amazonaws.com/vv-raw-videos/ba37b243-46c4-4f60-9a12-f6885b95c661.png",
"title":"NVP DemoDay - Vectorly",
"html":"<figure><iframe src=\"https://api.vectorly.io/embed/demo/ba37b243-46c4-4f60-9a12-f6885b95c661\" width=\"600\" height=\"338\" frameborder=\"0\" allowfullscreen ></iframe></figure>"
}

Like button doesn't give the "like" to the right url

I posted a question on stackoverflow and I haven't received any answers yet. maybe you can help me....
This is the problem:
Like buttons on my page that suppose to give "like" to different comments by their different 'href' given, raise the like count to all like buttons.
Link to my website page:
http://petbuy.co.il/ProductCard.aspx?product_id=7873&friend_Id=1000
look at the bottom of the page and try to "like" one of the comments and then refresh the page.. If you use a developer tool, you can see that every button iframe gets a different href... The "friend_id" param changes in each button href..
BUT !
If you look at the console log, you see that the response for this request of clicking the like button, uses only the first param of the url:
The href is:
http://petbuy.co.il/ProductCard.aspx?product_id=7873&friend_Id=1000
And it uses only the product_id=7873 without the friend_Id=1000.
I tried to switch the params, and this time it took only the friend_Id=1000".. I need them both :((
Thanks!!
Make sure you add the following Open Graph Metatag:
<meta property="og:url" content="http://petbuy.co.il/ProductCard.aspx?product_id=7873&friend_Id=1000" />
I did not find that tag at all in the code, it should be on EVERY page and it needs to match the URL.
Also make sure the URL is encoded correctly, see here: Encode URL in JavaScript?
...and i assume Server.URLEncode in ASP.
And always use the generator: https://developers.facebook.com/docs/plugins/like-button
It will show you exactly how the URL needs to show up in the code.
You need two diffrent urls for the like button
<div class="fb-like" data-href="http://petbuy.co.il/ProductCard.aspx?product_id=7873&friend_Id=2000" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
and
<div class="fb-like" data-href="http://petbuy.co.il/ProductCard.aspx?product_id=7873&friend_Id=1000" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
The Meta og:url is correct and describs the url of the page..

Wordpress Sign-ups Using GA Goal Tracking

I'm trying to use GA Tracking to Track Wordpress Sign-ups on my site. I'm assuming I need to use Goal Tracking and NOT Event tracking for this. I tried setting up goal tracking but it's not working. I am not using any GA plugins like Yoast, etc.
I can't get this to work with Wordpress:
I set my Goal URL to: /wp-login.php?checkemail=registered (URL landing page for sign-ups)
Match Type: "Exact Match"
No Goal Funnel was set.
GA is not tracking any of my sign-ups. What I am doing wrong here? My site is www.StreetofWalls.com if you would like to test.
The script that loads google-analytics isn't on the login page, so you're not getting any of the /wp-login.php?checkemail=registered pageviews sent back to google.
Put this on your wp-login.php page
<script type='text/javascript' src='http://www.streetofwalls.com/wp-content/themes/sow3/js/google-analytics.js'></script>
While TomFuertes's answer will work, it is not good to modify core WordPress files like wp-login.php. Updates to WordPress will overwrite any changes that you make and avoiding WordPress updates is a very bad idea.
I recommend adding the code using the login_head hook in your functions.php file:
function add_ga_to_login_page(){
echo '<script>';
echo 'GA TRACKING CODE HERE';
echo '</script>';
}
add_action('login_head', 'add_ga_to_login_page');

wordpress contact 7 URL Redirect with target=_blank

i wan to redirect my form after submit it i found the code which will do that
on_sent_ok: "location.replace('http://www.YOURSITE.com');"
but here is the twist i want redirect url with target blank .it means when visitor submit a form it will open a new page with target="_blank" link in contact 7 form of wordpress
please help me in it
Thanks
You have to use client-side code, like javascript.
hope this code helps
<?php
if(condition==true) {
?>
<script>
window.open("http://www.example.com");
</script>
<?php } ?>
I can't add comments. but just to clear this: if You use Contact Form 7 plugin you just need to paste the following in Additional settings tab of your form:
on_sent_ok: "window.open('http://example.com/');"
http://example.com/ is your URL off course.
But note, that you may have problems with browser popup settings,
because new tab is opening without user action/permission.

Wordpress' Contact Form 7 returns 404 but works on homepage

I've installed Contact Form 7 (v 3.1.1) into Wordpress (v 3.3.1). It works fine on the homepage (which is a static Page called 'Home') but on any other page it does nothing and the console says:
POST http://trademarkshop.ca/contact/ 404 (Not Found)
I'm using do_shortcode to call it from both theme files:
<?php echo do_shortcode('[contact-form-7 id="212" title="Contact form"]'); ?>
I have wp_footer() in the footer and wp_head() in the header. I have no other plugins installed. I've even checked for if(is_home()) restrictions. I also tried re-directing other pages to use the Home page template file, but still gives a 404 error.
I've never had this problem before. Any ideas would be very appreciated!
have you tried changing your permalinks to something else,
then save,
then change it back to /%postname%/
could be its not creating the htaccess file in the wp root,
hence your permalinks arent working,
Marty
use this code
<?php echo do_shortcode( '[contact-form-7 id="7" title="Contact"]' ); ?>
His problem is caused by a combination of two misconfigurations. First, AJAX JavaScript is not functioning on your contact form. Due to this problem, your contact form needlessly redirects after submission. Second, your contact form uses unavailable words in the names of input fields. This issue confuses WordPress, resulting in the 404 (“Not Found”) error.
https://contactform7.com/faq/my-contact-form-always-redirects-to-404-error-page-after-submission/
Change your Contact form 7 field names. Because some names already using by wordpress may be is conflicting.
Example:
name to username
Sometime that happen cause the code (id) in de form (When you try editing the error message on the left side there is a short html like code on witch there is an id) is not the same as the one when you go to dashboard>contact and the short code entry of the table. You need to change the first one to match the second one

Resources