Guest User

Untitled

a guest
Jul 29th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.56 KB | None | 0 0
  1. // quote
  2. function td_quote_center($atts, $content = null) {
  3. extract(shortcode_atts(
  4. array(
  5. 'color' => '', /* empty for default color OR color profile OR custom #color */
  6. ),
  7. $atts
  8. )
  9. );
  10.  
  11. $style_output = '';
  12. if ($color != '') {
  13. $style_output .= 'color:' . $color . '; ';
  14. }
  15.  
  16. return '<blockquote><p style="' . $style_output . '">' . $content . '</p></blockquote>' ;
  17. }
  18. add_shortcode('quote_center', 'td_quote_center');
  19.  
  20.  
  21. function td_quote_right($atts, $content = null) {
  22. extract(shortcode_atts(
  23. array(
  24. 'color' => '', /* empty for default color OR color profile OR custom #color */
  25. ),
  26. $atts
  27. )
  28. );
  29.  
  30. $style_output = '';
  31. if ($color != '') {
  32. $style_output .= 'color:' . $color . '; ';
  33. }
  34.  
  35. return '<blockquote class="td_quote td_quote_right"><p style="' . $style_output . '">' . $content . '</p></blockquote>' ;
  36. }
  37. add_shortcode('quote_right', 'td_quote_right');
  38.  
  39.  
  40. function td_quote_left($atts, $content = null) {
  41. extract(shortcode_atts(
  42. array(
  43. 'color' => '', /* empty for default color OR color profile OR custom #color */
  44. ),
  45. $atts
  46. )
  47. );
  48.  
  49. $style_output = '';
  50. if ($color != '') {
  51. $style_output .= 'color:' . $color . '; ';
  52. }
  53.  
  54. return '<blockquote class="td_quote td_quote_left"><p style="' . $style_output . '">' . $content . '</p></blockquote>' ;
  55. }
  56. add_shortcode('quote_left', 'td_quote_left');
  57.  
  58.  
  59. function td_quote_box_center($atts, $content = null) {
  60. return '<blockquote class="td_quote_box td_box_center"><p>' . $content . '</p></blockquote>' ;
  61. }
  62. add_shortcode('quote_box_center', 'td_quote_box_center');
  63.  
  64.  
  65. function td_quote_box_left($atts, $content = null) {
  66. return '<blockquote class="td_quote_box td_box_left"><p>' . $content . '</p></blockquote>' ;
  67. }
  68. add_shortcode('quote_box_left', 'td_quote_box_left');
  69.  
  70.  
  71. function td_quote_box_right($atts, $content = null) {
  72. return '<blockquote class="td_quote_box td_box_right"><p>' . $content . '</p></blockquote>' ;
  73. }
  74. add_shortcode('quote_box_right', 'td_quote_box_right');
  75.  
  76.  
  77. function td_pull_quote_center($atts, $content = null) {
  78. return '<blockquote class="td_pull_quote td_pull_center"><p>' . $content . '</p></blockquote>' ;
  79. }
  80. add_shortcode('pull_quote_center', 'td_pull_quote_center');
  81.  
  82.  
  83. function td_pull_quote_left($atts, $content = null) {
  84. return '<blockquote class="td_pull_quote td_pull_left"><p>' . $content . '</p></blockquote>' ;
  85. }
  86. add_shortcode('pull_quote_left', 'td_pull_quote_left');
  87.  
  88.  
  89. function td_pull_quote_right($atts, $content = null) {
  90. return '<blockquote class="td_pull_quote td_pull_right"><p>' . $content . '</p></blockquote>' ;
  91. }
  92. add_shortcode('pull_quote_right', 'td_pull_quote_right');
  93.  
  94.  
  95. //dropcaps
  96. function td_dropcap($atts, $content = null) {
  97. extract(shortcode_atts(
  98. array(
  99. 'label' => '', /* the text */
  100. 'bg_color' => '', /* empty for default color OR color profile OR custom #color */
  101. 'text_color' => '', /* empty for default color OR color profile OR custom #color */
  102. 'type' => '' /* empty = default type, 1 and 2 and 3 */
  103. ),
  104. $atts
  105. )
  106. );
  107.  
  108. $style_output = '';
  109.  
  110. //bg-color
  111. if ($bg_color != '') {
  112. $style_output .= 'background-color:' . $bg_color . '; ';
  113. }
  114.  
  115. //text-color
  116. if ($text_color != '') {
  117. $style_output .= 'color:' . $text_color . '; ';
  118. }
  119.  
  120. //parse the style
  121. if (!empty($style_output)) {
  122. $style_output = ' style="' . $style_output . '"';
  123. }
  124.  
  125. //parse the label
  126. if (!empty($content)) {
  127. $label = $content;
  128. }
  129.  
  130.  
  131. $class_output = '';
  132. switch ($type) {
  133. case '1':
  134. $class_output .= 'dropcap1 ';
  135. break;
  136.  
  137. case '2':
  138. $class_output .= 'dropcap2 ';
  139. break;
  140. case '3':
  141. $class_output .= 'dropcap3 ';
  142. break;
  143.  
  144. case '4':
  145. $class_output .= 'dropcap4 ';
  146. break;
  147. }
  148.  
  149.  
  150. return '<span class="dropcap ' . $class_output . '"' . $style_output . '>' . $label . '</span>';
  151. }
  152. add_shortcode('dropcap', 'td_dropcap');
  153.  
  154.  
  155.  
  156. //dividers
  157. function td_divider($atts, $content = null) {
  158. extract(shortcode_atts(
  159. array(
  160. 'label' => '', /* the text */
  161. 'bg_color' => '', /* empty for default color OR color profile OR custom #color */
  162. 'type' => '', /* empty = default type, 1 and 2 and 3 */
  163. 'height' => '' /* separator height, leave empty for auto (empty for the ones with graphics) works only with type 0 - 3 */
  164. ),
  165. $atts
  166. )
  167. );
  168.  
  169. $style_output = '';
  170.  
  171. //bg-color
  172. if ($bg_color != '') {
  173. $style_output .= 'border-color:' . td_get_color_profile($bg_color) . '; ';
  174. }
  175.  
  176. //bg-color
  177. if ($height != '') {
  178. $style_output .= 'border-width:' . $height . '; ';
  179. }
  180.  
  181. //parse the style
  182. if (!empty($style_output)) {
  183. $style_output = ' style="' . $style_output . '"';
  184. }
  185.  
  186. //parse the label
  187. if (!empty($content)) {
  188. $label = $content;
  189. }
  190.  
  191.  
  192. $class_output = '';
  193.  
  194. if (!empty($type)) {
  195. $class_output .= 'divider' . $type . ' ';
  196. }
  197.  
  198.  
  199. return '<div class="divider ' . $class_output . '"' . $style_output . '></div>';
  200. }
  201. add_shortcode('divider', 'td_divider');
Advertisement
Add Comment
Please, Sign In to add comment