I'm working on developing a plugin for Wordpress to enable social share buttons inside blockquotes (to share the quoted text on social networks Twitter and Facebook). So that sites would look like this: enter image description here

Here's the current js:

jQuery(document).ready(function () {
    var blockquotes = jQuery('blockquote');
    for (var i = 0; i < blockquotes.length; i++) {
        var blockQuoteText = jQuery(blockquotes[i]).text();
        var currentUrl = window.location;
        var textColor = jQuery(blockquotes[i]).css('color');
        // add share buttons (change TwitterName to your Twitter handle for automatic mentions)
        // change paths to the icons to suit your installation (download link below)
        jQuery(blockquotes[i]).append('<div class="quote-share"><div class="wrapper">' +
            '<a class="quote-twitter pop-up" style="color:' + textColor + '"' +
            'href="http://twitter.com/intent/tweet?status=' + blockQuoteText + '+' + currentUrl + '+%40' + data.twitter_id + '">' +
                '<span class="icon-twitter"/></a>' +
            '<a class="quote-facebook pop-up" style="color:' + textColor + '"' +
            'href="https://www.facebook.com/sharer/sharer.php?u=' + currentUrl + '&amp;src=sdkpreparse&title=' + blockQuoteText + '">' +
                '<span class="icon-facebook"/>' +

    // pop-up without being blocked by pop-up blockers
    jQuery('a.pop-up').live('click', function () {
        newwindow = window.open(jQuery(this).attr('href'), '', 'height=640,width=600');
        if (window.focus) {
        return false;

But then I came across Facebook's Quote plugin: https://developers.facebook.com/docs/plugins/quote Which would be perfect, but I can't figure out how to attach the plugin script to an icon, rather than the way they enabled it which is by highlighting text. Could anyone help me out with how to attach the new "Quote" sharing function for Facebook to a button than would then share the text within the blockquote?

  • Did you ever build this plugin? :) It would be great and I can't find anything that does it/ incorporates twitter and facebook in this way with blockquotes Commented May 20, 2021 at 20:22
  • @JoshuaKrige do not post comments as solutions. I converted your answer to a comment but as a 1 rep user you face imminent danger of being automatically flagged as a spambot if you try it again
    – Tom J Nowell
    Commented May 20, 2021 at 20:49

1 Answer 1


Kept on searching and found that I can just add a url parameter for the quote (source):

  • URL (of course) → u
  • custom image → picture
  • custom title → title
  • custom quote → quote
  • custom description → description



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.