I am trying to add facebook like button in every idea user posts. I followed the answer
How to embed a facebook like button on every webpage of my website? .
My URL is like this type :
mydomain.com/index.php?menu=post&post_id=12
I add the URL to facebook upto mydomain.com/index.php?menu=post . Now if I like the post with post_id 12 and then visit say post with post_id 13, it is already liked ! Where I am doing wrong ? I am using smarty template engine.
When you put the button's HTML into your website, don't specify a URL at all.
That way, it will take the URL of whatever page it's placed onto automatically.
if you are using fb meta tags for the like, it takes it from the index page. your going to need to change the title, and all the meta tags everytime post_id changes.
Search google for several like scripts, and you could implement your with that.
Hope I helped!
Related
I am new to wordpress, I have searched this thing on net but unable to find exact solution.
I have created a post that contains the Actor's Profile and the list of Movies Actor has worked in. Each Movie has also a different Wordpress Post that contains Movie details.
Now i want to create a link on each Movie, by which user can view the details of that particular movie.
This following link gives the result
<a href="http://localhost/wordpress/2015/10/09/movie-main-page">
but if i add this in each post, then it would be very difficult for me in future, when i will be uploading the site on web server, to change each link individually on every post.
I believe that there must be some way out there better than what i doing here, but somehow i am unable to find that trick.
Kindly guide me.
Thanks
You can use the get_site_url() template tag to return the site url and concatenate into the string. I haven't tested this code, so it might need some tinkering, but it should get you started:
<?php echo '<a href="' . get_site_url() . '/2015/10/09/movie-main-page">' ?>
wordpress link to anchor on another page
If Your Movie Page URL is Same Then You can use
echo get_permalink('11');
Here 11 is id of the page/post.
or if you have different different post for movies that can have different urls.
You can use wp_query loop for each post
[https://codex.wordpress.org/Class_Reference/WP_Query][1]
and use simply **echo get_permalink();**
There are two ways to achieve what you're doing.
The first and easiest way would be to run a search and replace on the database to change any URL's in your posts to the new URL. You should have a look at https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ .
You could also use Advanced Custom Fields to Achieve this. You would need to use the post object field to link to another page within wordpress. With the post object field you can create a field for each post that links to another post which you can then display in your template. Take a look here https://www.advancedcustomfields.com/resources/post-object/. With this method you could transfer all the content and associated links would still work.
We just implemented a Facebook like button everywhere on our site. However, it works a little bit weird on one of the pages.
If you click on the like button anywhere and then write a comment, it only posts once on Facebook. This is the correct behavior.
Unfortunately, on the another page it creates two items on your Facebook wall.
Has anybody previously seen the same problem on any site?
I use an iframe, and the link is what I call there:
www.facebook.com/plugins/like.php?href=%s;send=false&layout=standard&show_faces=false&;action=like&colorscheme=light&font=arial&height=35&appId=%s
The first %s is the current URL, the second %s is an appid.
Its a common bug, ive got a facebook like box too. And when i like my own page it will be liked twice. You cant do anything about it. Other visitors who like your page will only show up once.
friends,
how we can grab posts and comments from gplus business page ?
My page link look like https://plus.google.com/b/xxxxxxxxx/ .
I got the api to get details from an account using the following method.
https://www.googleapis.com/plus/v1/people/108189587050871927619/activities/public?key=yourAPIKey
but i couldnt find any thing for business page.
am using php for developing the code.
Thanks in advance..
A page is a "user" like any other - grab the ID displayed in the URL when you're browsing the page's posts, and look up the public posts for that id.
I got a really stupid question. But I'm in the startup-fase of integrating a webpage with Facebook.
My question is if a Facebook page has a App-id? If that's the case, how can I find it?
What I'm trying to do is add multiple comment-plugins and would like them to be linked to my page. Perhaps even so that the comments appears on the pages wall.
Thanks in advance!
If you are the admin of the page you can get the page ID.
Go to your page, click Edit Page then Update info (not sure if these are the terms cause I use FB in portuguese language).
The URL in the adress bar tells you the ID. Its the number between 'id=' and the '&' symbol. Lets say it's 1234567890. Copy it.
Now, in a comment just write #[1234567890:Name of the Page]. Submit your comment and see what happens.
Hope that helps.
A facebook page doesnt have an ID, you need to register a new app for your page.
You can create an app here
I have a website where i implement a wall of messages, the idea is to add to each of this wall messages a like button, where clicking on it would immediately post on the user's facebook profile page that he likes THAT SPECIFIC COMMENT.
Is this possible? I just enter this new world of facebook php developers, and as far as I have read here it always talks about adding a Like button for a specific URL. I would like to make the like button apply for the specific post within the messages wall.
I am clueless as where to start, if by the way any one could recommend a detailed tutorial on how to integrate a website to facebook in its different ways, i would really appreciate it.
EDIT:
Looking into #Kaan Soral suggestion of using open graph, I think it is important to add that I dont want each wall post that the user likes to appear in the "Likes and Interests" section of his profile... This wouldn't make sense because he would rapidly have loads of likes of separate wall posts.
Its possible, read this: http://developers.facebook.com/docs/opengraph/
You have to create a URL for every item that will be liked and on that URL there should be META tags for descriptions, image etc