iDC WordPress Shortcode (param-less)

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

Shortcode to insert 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="'. $url .'" class="idcRankAnchor">'
  4. .'<img src="'.$url
  5. .'" title="Vote on" alt="Vote on" class="idcRankImage" />
  6. </a>';
  7. } add_shortcode("idc","idcRankHandler"); //Attaching iDC handler

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.