Alert Shortcodes


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



Copy this code and paste it in your HTML
  1. /**** WP Function & CSS ****/
  2.  
  3. // Alert Shortcodes
  4. function alert_green($atts, $content = null) {
  5. return'<div class="alert-green">' . $content . '</div>';
  6. }
  7. add_shortcode('alert_green', 'alert_green');
  8.  
  9. function alert_blue($atts, $content = null) {
  10. return'<div class="alert-blue">' . $content . '</div>';
  11. }
  12. add_shortcode('alert_blue', 'alert_blue');
  13.  
  14. function alert_yellow($atts, $content = null) {
  15. return'<div class="alert-yellow">' . $content . '</div>';
  16. }
  17. add_shortcode('alert_yellow', 'alert_yellow');
  18.  
  19. function alert_red($atts, $content = null) {
  20. return'<div class="alert-red">' . $content . '</div>';
  21. }
  22. add_shortcode('alert_red', 'alert_red');
  23.  
  24. /* Alert Shortcodes */
  25.  
  26. /* Buttons, message boxes, & alert boxes */
  27. .alert-green {
  28. -moz-border-radius:3px;
  29. -webkit-border-radius:3px;
  30. border-radius:3px;
  31. background:#e5ffcc url(images/alert_green.png) left center no-repeat;
  32. color:#573;
  33. border:1px solid #bbdd99;
  34. padding:10px 10px 10px 40px;
  35. margin:10px 0 20px 0;
  36. }
  37. .alert_blue {
  38. -moz-border-radius:3px;
  39. -webkit-border-radius:3px;
  40. border-radius:3px;
  41. background:#e5f5ff url(images/alert_blue.png) left center no-repeat;
  42. color:#467;
  43. border:1px solid #bde;
  44. padding:10px 10px 10px 40px;
  45. margin:10px 0 20px 0;
  46. }
  47. .alert_yellow {
  48. -moz-border-radius:3px;
  49. -webkit-border-radius:3px;
  50. border-radius:3px;
  51. background:#ffd url(images/alert_yellow.png) left center no-repeat;
  52. color:#664;
  53. border:1px solid #ddc;
  54. padding:10px 10px 10px 40px;
  55. margin:10px 0 20px 0;
  56. }
  57. .alert_red {
  58. -moz-border-radius:3px;
  59. -webkit-border-radius:3px;
  60. border-radius:3px;
  61. background:#fcc url(images/alert_red.png) left center no-repeat;
  62. color:#744;
  63. border:1px solid #daa;
  64. padding:10px 10px 10px 40px;
  65. margin:10px 0 20px 0;
  66. }
  67.  
  68. /* end ---------------------------------------- alert codes */

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.