Insert a PayPal button to SocButtons

On my quest to keep my site self-sustaining I needed a PayPal donate button on my social share buttons list, which in my case was the SocButtons plugin.  

Here's how I added a PayPal donate button to SocButtons (horizontal row layout):

1. Open button generation page from PayPal button
2. Click on "Customize text or appearance"
3. Select "Use smaller button" and deselect "Display credit card logos"
4. Generate & copy button code
5. Open \plugins\content\socbuttons\socbuttons.php 
6. On line 192 create a new line and insert this code:

$html .= '<div style="float: right; margin-left: 15px; margin-top: -2px;"> your form code here </div>'; 

7. In that line replace 'your form code here' with your PayPal button code which is far too long to post in here as an example
8. Save and refresh page.  

The result should be something similar:

 SocButtons with PayPal donate button

Now you should have a Donate button next to your other buttons in SocButtons in horizontal layout. 

Doesn't fit? Play around with the margin-left and margin-top parameters. 


If this article helped you, feel free to leave me some $.

About me

Iinstructor of robotics (LEGO Mindstorms), computer teacher, IT support, web dev, currently studying cyber-physical systems engineering.

If you found a solution here, would you consider donating $25,000 for my next project?

Just kidding, 1$ would do fine.

Hope you found what you needed. Thanks for stepping by.