Posted By

manavecplan on 09/12/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

lb8099


Create a download button


 / Published in: PHP
 

  1. function download($atts, $content = null) {
  2. extract(shortcode_atts(array(
  3. "url" => ''
  4. ), $atts));
  5. return '<a class="download" href="'.$url.'">'.$content.'</a>';
  6. }
  7. add_shortcode('download', 'download');
  8.  
  9. .download {
  10. display: inline-block;color:#fff;
  11. font-weight:bold;
  12. font-size:1.2em;
  13. background : -webkit-gradient(linear, left top, left bottom, from(#88c841), to(#73b338));
  14. background : -moz-linear-gradient(center top, #88c841, #73b338);
  15. -webkit-border-radius: 5px;
  16. -moz-border-radius: 5px;
  17. border-radius: 5px;
  18. padding: 5px 20px;
  19. text-align: center;
  20. -shadow: 0px 1px 0px #6c0909;
  21. }
  22.  
  23. .download:hover {
  24. background : -webkit-gradient(linear, left top, left bottom, from(#73b338), to(#88c841));
  25. background : -moz-linear-gradient(center top, #73b338, #88c841);
  26.  
  27.  
  28.  
  29.  
  30.  
  31. [download url="http://www.google.com"]Download Google Chrome[/download]
  32. }

Report this snippet  

You need to login to post a comment.