Advertisement
Guest User

Support Themewaves

a guest
May 5th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.62 KB | None | 0 0
  1. <?php
  2. /* ================================================================================== */
  3. /* IconBox Shortcode
  4. /* ================================================================================== */
  5. $atts = shortcode_atts(array(
  6. 'css' => '',
  7. 'custom_class' => '',
  8. 'element_class' => 'tw-element tw-iconbox',
  9. 'element_dark' => '',
  10. 'animation' => 'none',
  11. 'animation_delay' => '',
  12. // ----------------
  13. 'title' => 'Iconbox Title',
  14. 'layout' => 'top',
  15. 'moretext' => 'read more',
  16. 'customlink' => '#',
  17. // Font Icon
  18. 'icon' => 'fontawesome',
  19. 'fontawesome' => '',
  20. 'openiconic' => '',
  21. 'typicons' => '',
  22. 'entypo' => '',
  23. 'linecons' => '',
  24. 'pixelicons' => '',
  25. 'fi_image' => '',
  26. // Font Icon Style
  27. 'fi_color' => '',
  28. 'fi_border_color' => '',
  29. 'fi_bg_color' => '',
  30. 'fi_size' => '',
  31. 'fi_padding' => '',
  32. 'fi_border' => '',
  33. 'fi_round' => '',
  34. ), vc_map_get_attributes($this->getShortcode(),$atts));
  35.  
  36. $class = '';
  37. if(!empty($atts['layout'])){
  38. $class.=' '.$atts['layout'].'-iconbox';
  39. }
  40.  
  41. $class .=apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $atts['css'], ' ' ), $this->settings['base'], $atts );
  42. $output = waves_item($atts,$class);
  43. $btn = $style = '';
  44. $icon = waves_icon($atts,true,true);
  45. if(!empty($atts['customlink']) && !empty($atts['moretext'])){
  46. $btn = '<a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $atts['moretext'] . '<i class="fa fa-angle-right"></i></a>';
  47. }
  48. if ($atts['layout'] === 'left' || $atts['layout'] === 'right'){
  49. $style = 'margin-'.$atts['layout'].':' . (($atts['fi_padding'] + $atts['fi_border']) * 2 + $atts['fi_size'] + 4 + 30) . 'px;';
  50. }
  51.  
  52. if($atts['layout']==='small-left'||$atts['layout']==='small-right'){
  53. $layout = explode( '-', $atts['layout'] );
  54. $style = 'margin-'.$layout[1].':' . (($atts['fi_padding'] + $atts['fi_border']) * 2 + $atts['fi_size'] + 4 + 20) . 'px;';
  55. $style2 = 'margin-top:-' . (($atts['fi_padding'] + $atts['fi_border']) * 2 + $atts['fi_size'] + 4)/2 . 'px;';
  56. $output .= '<div class="tw-iconbox-box">';
  57. $output .= '<div class="tw-iconbox-content">';
  58. $output .= '<div class="iconbox-title"><div class="small-icon" style="'.$style2.'"><a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $icon.'</a>';
  59. $output .= '</div><h3 style="' . $style . '"><a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $atts['title'] . '</a></h3></div>';
  60. $output .= '<p>' . strip_tags($content) . '</p>';
  61. $output .= $btn;
  62. $output .= '</div>';
  63. $output .= "</div>";
  64. }else{
  65. $output .= '<div>';
  66. $output .= '<div class="tw-iconbox-box">';
  67. $output .= '<div class="tw-iconbox-icon"><a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $icon . '</a></div>';
  68. $output .= '<div class="tw-iconbox-content" style="' . $style . '">';
  69. $output .= '<h3><a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $atts['title'] . '</a></h3>';
  70. $output .= '<p>' . strip_tags($content) . '</p>';
  71. $output .= $btn;
  72. $output .= '</div>';
  73. $output .= "</div>";
  74. $output .= "</div>";
  75. }
  76. $output .= "</div>";
  77. /* ================================================================================== */
  78. echo balanceTags($output);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement