This is a really useful function that will allow you to use a shortcode to easily add a donation link as you’re writing a post. If you often take donations, add this to your theme’s functions.php file to make the shortcode available for use at any time:
function donate_shortcode( $atts ) {
extract(shortcode_atts(array(
'text' => 'Make a donation',
'account' => 'REPLACE ME',
'for' => '',
), $atts));
global $post;
if (!$for) $for = str_replace(" "," ",$post->post_title);
return '<a class="donateLink" href="https:>'.$text.'</a>';
}
add_shortcode('donate', 'donate_shortcode');
You can replace the text with your own and also replace the account section with your PayPal email address. Now when you’re writing a page or post, you can add the shortcode:
[donate]
You’ll get a link automatically added to your post, as shown below:

Source: ThemeForest.net
Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more
If you've ever wondered how you could offer a paid site management and hosting service, then this is the plugin for you. Offer a freemium or paid service, for any niche you like, it's powered Edublogs.org to success already!
Find out more
Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more
To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more
Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more
If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more
Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more
Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more
No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more
I buy houses and apartments in Indiana – specializing in Lafayette, West Lafayette and Tippecanoe county. Inherited, foreclosure, or repairs are no problem. I pay CASH and close on the date of your choice.
Pingback: How to Add A Paypal Donation Shortcode button to your posts « graphicbeacon
Hi Sarah,
I like the code you gave but I added some slight adjustments, making use of the inbuilt $content variable and added a title attribute to the link. You can see this here:
http://www.graphicbeacon.com/how-to-add-a-paypal-donation-shortcode-button-to-your-posts/
Let me know what you think.
Диваны и кресла фабрика детский диванчик
That is pretty neat. May actually use this shortcut for future jobs.