WordPress.org

Ready to get started?Download WordPress

Forums

Seamless Donations
[resolved] Trying to add a block for a like button (4 posts)

  1. jpaytoncfd
    Member
    Posted 3 months ago #

    Your plugin works great, I am trying to add a block to the top that has a facebook like button.

    This is the section and you can see the two lines I added. There is no effect to the output from this. Everything still works but this code is not added to the output.

    function dgx_donate_get_donation_section($formContent)
    {
      $output = "";
    	$output .= "<div class=\"dgx-donate-form-section\"> <iframe src=\"//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fcarouselhorsefarm&width&height=62&colorscheme=light&show_faces=false&header=true&stream=false&show_border=true&appId=218686238317613\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; height:62px;\" allowTransparency=\"true\"></iframe></div>";
      $output = "";
    	$output .= "<div class=\"dgx-donate-form-section\">\n";
    	$output .= "<h2>" . esc_html__( 'Donation Information', 'dgx-donate' ) . "</h2>\n";
    
    	$output .= "<p>" . esc_html__( 'I would like to make a donation in the amount of:', 'dgx-donate' ) . "</p>";

    I was trying to do a facebook like lock but none of them worked with this plugin so this is the alternative. If you can point me in the direction of what I am missing it would be so helpful.

    This is the page http://chfmaine.com/donations/

    http://wordpress.org/plugins/seamless-donations/

  2. allendav
    Member
    Plugin Author

    Posted 3 months ago #

    Hi! I don't recommend changing the plugin (you'll lose your changes on the next release of seamless donations, but what dgx_donate_get_donation_section does is concatenate to the $output variable each piece of the form

    In PHP, that's using .=

    if you use $output .= to add things, it should work.

    Alternatively, may I suggest just adding the facebook like button code to the page above the dgx-donate shortcode?

  3. jpaytoncfd
    Member
    Posted 3 months ago #

    Thanks for the response. I figured it out. I had to remove the second $output = "";

    Once I did that it worked great. We only use the plugin for promotions so would likely not update it or change it unless there was a new feature.

    Its a great plugin and should be very helpful once we work the legal bugs out..

    Thanks,
    Joe

  4. allendav
    Member
    Plugin Author

    Posted 2 months ago #

    Awesome! Glad to hear it.

    Cheers...

    ...Allen

Reply

You must log in to post.

About this Plugin

About this Topic

Tags