I want to publish comment on different facebook pages from my site, is it possible? - facebook-page

I'm working on a website which is a media website. On my website I've different shows in a dropdown and I've created different pages on facebook for all those shows. I can select show from the dropdown and give some comment in the comment box on my website. Now, can I post this comment on the facebook page for the show which is selected from the dropdown? Is it possible? If possible then please provide the code to do this.
Thanks for your help

If possible then please provide the code to do this.
plz send me teh codez questions are generally not "acceptable" on StackOverflow.
Your solution is to supply the to field of the FB.ui's feed method and set it to the page id value selected in your dropdown.
FB.ui({
method: 'feed',
to: facebookPageId,
link: urlToShare
},
function(response) {
if(response && response.post_id) alert('Posted!');
});
More information on the FB.ui can be found here: https://developers.facebook.com/docs/reference/javascript/FB.ui/

Related

Wordpress add new record custom admin.php not working

I have some custom wordpress migration, where there are a few custom plug-ins.
The problem which I am facing is that I have add new team member as link the folling link:
Add New
so when I press that button I am getting the form but no input fields are presented.
The question is more of where to be looking in order to resolve this, since it is using admin.php wordpress functionality? Any suggestion or guidance will help. Thanks.
A late answer but...
Some key guidance is given in Admin Screen Reference. See:
Top level pages admin.php?page={page_slug} toplevel_page_{page_slug}
Sub pages admin.php?page={page_slug} {parent_slug}_page_{page_slug}
So, you are working with either a (top) menu page or a sub menu page.
You need to search for calls to add_menu_page() and add_submenu_page() that pass wb_team_list as $menu_slug. The $function passed in the function call generates the page content.
(The answer was verified against the theme I am currently working with.)

How to view additional pages under google search result

IO just want to show my additional page link like this Google search page result. How to do that easily. I'm using WordPress.
Here is the image link that i need to do. http://i.stack.imgur.com/Yyn8g.jpg
Thank's in advance!
There are 2 types of sitelinks that show up in SERPs: the one you showed and an expanded view. The one that you showed is generated by google and cannot be influenced easily.
Heres a 2009 Post about it:
http://googlewebmastercentral.blogspot.com/2009/04/one-line-sitelinks.html
And here is a discussion on MOZ about it:
https://moz.com/community/q/has-anyone-found-a-way-to-get-site-links-in-the-serps

Wordpress - Disable "Are you sure you want to navigate away from this page?" when saving custom post

I have a Wordpress site very customized where there are a lot of contributors and lots of posts are published. When you try to publish/update a custom post it displays a popup saying "The changes you made will be lost if you navigate away from this page. Are you sure you want to leave this page?".
This only happens when the modified/new content of the post is in custom fields corresponding to "Advanced Custom Fields" plugin. This popup is very annoying for the contributors. So I would like to know if is possible to disable this popup or any way to fix that.
Thanks.
Ok, so I was able to track down the cause. It is a JS function in ACF called unload.
All you have to do is add some JS:
jQuery( document ).ready( function() {
// disable the ACF js navigate away pop up
acf.unload.active = false;
} );
Reference:
http://support.advancedcustomfields.com/forums/topic/how-to-disable-js-alert-in-acf_form/
A more general answer in regards to WP's confirmation dialog:
Within wp-admin/js/post.js of WordPress-4.8 on line 481 you can find the mechanism behind the "navigate away" confirmation dialog.
The event: beforeunload.edit-post is initiated via jQuery's .on() function. jQuery gives you the ability to unbind event handlers via the .off() function.
By adding the following to your Javascript, you can disable this confirmation dialog when needed. WordPress itself also uses it when you hit the submit (Publish) button on a post for example.
// Prevent WP from asking confirmation to navigate away from the current post.
jQuery(window).off( 'beforeunload.edit-post' );
P.S. WordPress specific questions should be asked at: https://wordpress.stackexchange.com/
jQuery(document).ready(function()
{
jQuery(window).off("beforeunload", null);
});
Still valid on wordpress 5.9
So, I was trying to track down how WordPress itself handled this.
Here is what I found out:
There is an eventListener on publish or edit button of WordPress.
That actually runs the below code:
jQuery(window).off("beforeunload.edit-post")
So, Using the same way you also can disable that.

Facebook comments box plugin + dynamic url on asp?

I'm trying to put the FB comments box on the bottom of each of my products pages on my site. I have managed to do this but when set to a static url it says the same comments on every product. I deleted the url and now it kind of works but says the plugin is in compatabilty mode.
Heres whats in my products template:
My site is trickscooter.co.uk so you can see. The comments box is at the bottom of every product.
I want people to be able to ask questions on the item shown so I can answer them so all can see.
PS - It says this:
Warning: this comments plugin is operating in compatibility mode, but has no posts yet. Consider specifying an explicit 'href' as suggested in the comments plugin documentation to take advantage of all plugin features.
Thanks !
The static URL won't do for the 'href' parameter as that parameter tells Facebook which comments to show. If you always use the same URL, of course you get always the same comments. You should have a unique url per product and use that dynamically.
If you generate the href parameter dynamically, you need to be aware that you will loose comments if your page is accessible under different domains.
The best way is to configure a 'facebook domain' (e.g. 'www.foo.example') and use that to generate your href attribute for Facebook comments.
If I misunderstood you please explain your current embedding code and what you tried. If you like the answer, please mark it as 'solution'.

Google Analytics in Wordpress - Cross-Domain Tracking

I've searched high and low for an answer for this problem and need the help of experts.
The website I'm helping to oversee has a registration in a frame on their main website. When a user visits the site, they can choose which course to take and click on a "Register" link to be taken to the externally hosted form.
I was able to get the GA tags changed on the framed pages, so that step is done.
However, I realise that in order to properly cross-domain track with Google Analytics, I need to also add an onclick event to any links that bring users to those pages, such as the example below.
Link
However, the site I'm working with is in Wordpress, and when I view the link in there it looks like this:
[iab_event link="http://www.EXAMPLESITE.com/course/4105/register.asp" text="Register"]
And when you view the page source of the live site this link is translated to this:
Register
I tried adding the second onclick event to the one above, but that didn't work. Is there any way to add the onClick="pageTracker._link('http://www.EXAMPLESITE.com/course/4105/register.asp'); return false;" to this link without breaking it?
Thank you in advance for any advice given!
Try stacking them in the onclick event like this:
Register
It should run all of the commands as long as they're separated by semi-colons.

Resources