iDC WordPress Shortcode


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

Shortcode to insert iDevCenter.com rank in a WP blog post.


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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.