iDC WordPress Shortcode (param-less)


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

Shortcode to insert iDevCenter.com rank in a WP blog post.
it doesn't need the id parameter to be passed. (more efficient one)


Copy this code and paste it in your HTML
  1. function idcRankHandler(){
  2. $url = rawurlencode(get_permalink($post->ID));
  3. return '<a href="http://idevcenter.com/links/vote?url='. $url .'" class="idcRankAnchor">'
  4. .'<img src="http://idevcenter.com/links/image?url='.$url
  5. .'" title="Vote on iDevCenter.com" alt="Vote on iDevCenter.com" class="idcRankImage" />
  6. </a>';
  7. } add_shortcode("idc","idcRankHandler"); //Attaching iDC handler

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.