WordPress.org

Ready to get started?Download WordPress

Forums

Ajaxify WordPress Site(AWS)
[resolved] Display facebook comments section on AJAX loaded content (2 posts)

  1. Subharanjan
    Member
    Posted 1 year ago #

    Hi Manish, Thanks for such a nice plugin to make wordpress website AJAXified. I found a problem where Facebook Comments does not show up on AJAX loaded contents. So I have made a little change in the ajaxify.js file to call FB.XFBML.parse() function and the facebook comments now display fine. Let me know if this is Ok.

    // Ajax Request the Traditional Page
    $.ajax({
        url: url,
        success: function(data, textStatus, jqXHR){
            // Prepare
            var
                $data = $(documentHtml(data)),
                $dataBody = $data.find('.document-body:first'),
                $dataContent = $dataBody.find(contentSelector).filter(':first'),
                $menuChildren, contentHtml, $scripts;
            ...
            ...
            //facebook comments
            var isFacebook = $data.find('.fb-comments');
            if(isFacebook != 'undefined' ) {
                var scriptText = 'FB.XFBML.parse();';
                var scriptNode = document.createElement('script');
                scriptNode.appendChild(document.createTextNode(scriptText));
                contentNode.appendChild(scriptNode);
            }
            ...
            ...
        },

    For more info visit my blog: http://www.subharanjan.in/loading-facebook-social-plugin-into-ajax-generated-dynamic-content-solved/

    http://wordpress.org/extend/plugins/ajaxify-wordpress-site/

  2. manishkrag
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks Subh :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic