Guest User

Untitled

a guest
Jul 7th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. function td_quote_center($atts, $content = null) {
  2. return '<blockquote><p>' . $content . '</p></blockquote>' ;
  3. }
  4. add_shortcode('quote_center', 'td_quote_center');
  5.  
  6.  
  7. function td_quote_right($atts, $content = null) {
  8. return '<blockquote class="td_quote td_quote_right"><p>' . $content . '</p></blockquote>' ;
  9. }
  10. add_shortcode('quote_right', 'td_quote_right');
  11.  
  12.  
  13. function td_quote_left($atts, $content = null) {
  14. return '<blockquote class="td_quote td_quote_left"><p>' . $content . '</p></blockquote>' ;
  15. }
  16. add_shortcode('quote_left', 'td_quote_left');
  17.  
  18.  
  19. function td_quote_box_center($atts, $content = null) {
  20. return '<blockquote class="td_quote_box td_box_center"><p>' . $content . '</p></blockquote>' ;
  21. }
  22. add_shortcode('quote_box_center', 'td_quote_box_center');
  23.  
  24.  
  25. function td_quote_box_left($atts, $content = null) {
  26. return '<blockquote class="td_quote_box td_box_left"><p>' . $content . '</p></blockquote>' ;
  27. }
  28. add_shortcode('quote_box_left', 'td_quote_box_left');
  29.  
  30.  
  31. function td_quote_box_right($atts, $content = null) {
  32. return '<blockquote class="td_quote_box td_box_right"><p>' . $content . '</p></blockquote>' ;
  33. }
  34. add_shortcode('quote_box_right', 'td_quote_box_right');
  35.  
  36.  
  37. function td_pull_quote_center($atts, $content = null) {
  38. return '<blockquote class="td_pull_quote td_pull_center"><p>' . $content . '</p></blockquote>' ;
  39. }
  40. add_shortcode('pull_quote_center', 'td_pull_quote_center');
  41.  
  42.  
  43. function td_pull_quote_left($atts, $content = null) {
  44. return '<blockquote class="td_pull_quote td_pull_left"><p>' . $content . '</p></blockquote>' ;
  45. }
  46. add_shortcode('pull_quote_left', 'td_pull_quote_left');
  47.  
  48.  
  49. function td_pull_quote_right($atts, $content = null) {
  50. return '<blockquote class="td_pull_quote td_pull_right"><p>' . $content . '</p></blockquote>' ;
  51. }
  52. add_shortcode('pull_quote_right', 'td_pull_quote_right');
  53.  
  54.  
  55. //dropcaps
  56. function td_dropcap($atts, $content = null) {
  57. extract(shortcode_atts(
  58. array(
  59. 'label' => '', /* the text */
  60. 'bg_color' => '', /* empty for default color OR color profile OR custom #color */
  61. 'text_color' => '', /* empty for default color OR color profile OR custom #color */
  62. 'type' => '' /* empty = default type, 1 and 2 and 3 */
  63. ),
  64. $atts
  65. )
  66. );
  67.  
  68. $style_output = '';
  69.  
  70. //bg-color
  71. if ($bg_color != '') {
  72. $style_output .= 'background-color:' . $bg_color . '; ';
  73. }
  74.  
  75. //text-color
  76. if ($text_color != '') {
  77. $style_output .= 'color:' . $text_color . '; ';
  78. }
  79.  
  80. //parse the style
  81. if (!empty($style_output)) {
  82. $style_output = ' style="' . $style_output . '"';
  83. }
  84.  
  85. //parse the label
  86. if (!empty($content)) {
  87. $label = $content;
  88. }
  89.  
  90.  
  91. $class_output = '';
  92. switch ($type) {
  93. case '1':
  94. $class_output .= 'dropcap1 ';
  95. break;
  96.  
  97. case '2':
  98. $class_output .= 'dropcap2 ';
  99. break;
  100. case '3':
  101. $class_output .= 'dropcap3 ';
  102. break;
  103.  
  104. case '4':
  105. $class_output .= 'dropcap4 ';
  106. break;
  107. }
  108.  
  109.  
  110. return '<span class="dropcap ' . $class_output . '"' . $style_output . '>' . $label . '</span>';
  111. }
  112. add_shortcode('dropcap', 'td_dropcap');
Advertisement
Add Comment
Please, Sign In to add comment