Facebook fanbox problem

You can use the asynchronous XFBML javascript but you have to register an app and get an appID. Here is the function I use to add the XFBML to the footer. Note: This will work for the like button also. add_action(‘wp_footer’, ‘c3m_share_this_scripts’ ); function c3m_share_this_scripts() { echo ‘ <script>’; echo ” window.fbAsyncInit = function() {; … Read more

Comment form in wordpress theme returns a javascript alert

I tried removing all the javascript of the theme, updating the comments related files in the server (the same error happens locally) The problem is a result of this file(you obviously didn’t disable that one in testing). http://www.faf.fi/wp-content/themes/faf/scripts/js/functions.js Blocking that script in my browser resolves the issue, but i think it’s this area of the … Read more

Best way to add some custom javascript using jquery to a child theme

Here you go. add_action(‘init’, ‘register_custom_jquery’); function register_custom_jquery() { wp_deregister_script(‘jquery’); wp_register_script( ‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js’, array(), ‘1.6.1’ ); wp_register_script( ‘my-custom-script’, ‘http://example.com/js/script.js’, array(), ‘1.0’ ); } add_action(‘wp_enqueue_scripts’, ‘add_js_to_page’); function add_js_to_page() { wp_enqueue_script( ‘jquery’ ); wp_enqueue_script( ‘my-custom-script’ ); }