Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* ================================================================================== */
- /* IconBox Shortcode
- /* ================================================================================== */
- $atts = shortcode_atts(array(
- 'css' => '',
- 'custom_class' => '',
- 'element_class' => 'tw-element tw-iconbox',
- 'element_dark' => '',
- 'animation' => 'none',
- 'animation_delay' => '',
- // ----------------
- 'title' => 'Iconbox Title',
- 'layout' => 'top',
- 'moretext' => 'read more',
- 'customlink' => '#',
- // Font Icon
- 'icon' => 'fontawesome',
- 'fontawesome' => '',
- 'openiconic' => '',
- 'typicons' => '',
- 'entypo' => '',
- 'linecons' => '',
- 'pixelicons' => '',
- 'fi_image' => '',
- // Font Icon Style
- 'fi_color' => '',
- 'fi_border_color' => '',
- 'fi_bg_color' => '',
- 'fi_size' => '',
- 'fi_padding' => '',
- 'fi_border' => '',
- 'fi_round' => '',
- ), vc_map_get_attributes($this->getShortcode(),$atts));
- $class = '';
- if(!empty($atts['layout'])){
- $class.=' '.$atts['layout'].'-iconbox';
- }
- $class .=apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $atts['css'], ' ' ), $this->settings['base'], $atts );
- $output = waves_item($atts,$class);
- $btn = $style = '';
- $icon = waves_icon($atts,true,true);
- if(!empty($atts['customlink']) && !empty($atts['moretext'])){
- $btn = '<a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $atts['moretext'] . '<i class="fa fa-angle-right"></i></a>';
- }
- if ($atts['layout'] === 'left' || $atts['layout'] === 'right'){
- $style = 'margin-'.$atts['layout'].':' . (($atts['fi_padding'] + $atts['fi_border']) * 2 + $atts['fi_size'] + 4 + 30) . 'px;';
- }
- if($atts['layout']==='small-left'||$atts['layout']==='small-right'){
- $layout = explode( '-', $atts['layout'] );
- $style = 'margin-'.$layout[1].':' . (($atts['fi_padding'] + $atts['fi_border']) * 2 + $atts['fi_size'] + 4 + 20) . 'px;';
- $style2 = 'margin-top:-' . (($atts['fi_padding'] + $atts['fi_border']) * 2 + $atts['fi_size'] + 4)/2 . 'px;';
- $output .= '<div class="tw-iconbox-box">';
- $output .= '<div class="tw-iconbox-content">';
- $output .= '<div class="iconbox-title"><div class="small-icon" style="'.$style2.'"><a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $icon.'</a>';
- $output .= '</div><h3 style="' . $style . '"><a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $atts['title'] . '</a></h3></div>';
- $output .= '<p>' . strip_tags($content) . '</p>';
- $output .= $btn;
- $output .= '</div>';
- $output .= "</div>";
- }else{
- $output .= '<div>';
- $output .= '<div class="tw-iconbox-box">';
- $output .= '<div class="tw-iconbox-icon"><a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $icon . '</a></div>';
- $output .= '<div class="tw-iconbox-content" style="' . $style . '">';
- $output .= '<h3><a class="read-more" href="' . esc_url($atts['customlink']) . '">' . $atts['title'] . '</a></h3>';
- $output .= '<p>' . strip_tags($content) . '</p>';
- $output .= $btn;
- $output .= '</div>';
- $output .= "</div>";
- $output .= "</div>";
- }
- $output .= "</div>";
- /* ================================================================================== */
- echo balanceTags($output);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement