Follow me on twitter short code


/ Published in: PHP
Save to your folder(s)

Follow me on twitter flexible user and message
Add to post [twitter username='VeronicaDjeneva']Follow me Somebody[/twitter]


Copy this code and paste it in your HTML
  1. <?php
  2. /*
  3. Plugin Name: Twitter Shower
  4. Plugin URI: http://www.scoldy.com
  5. Discription: Simple shortcode
  6. Version: 1.0
  7. Author: Ronnie
  8. Author URI: http://www.scoldy.com
  9. */
  10.  
  11. add_shortcode('twitter', function($atts,$content) {
  12. if( !isset($atts['username'])) $atts['username'] = 'VeronicaDjeneva';
  13. if( empty($content)) $content = 'Follow me on Twitter';
  14. return '<a href="http://twitter.com/' .$atts['username'].'">' .$content.'</a>';
  15. });
  16.  
  17. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.