feature box shortcode with visual composer
commet feature box shortcode:-
<?php
function commet_featured($one, $two){
$commet = shortcode_atts([
'fb-style' =>' ',
'fb-icon' =>' ',
'fb-title' =>' ',
'fb-cont' =>' ',
], $one);
ob_start();
?>
<?php if ($commet['fb-style'] == 's4') : ?>
<div class="icon-box-simple"><i class="<?php echo $commet['fb-icon']; ?>"></i><span><?php echo $commet['fb-title']; ?></span></div>
<?php elseif ($commet['fb-style'] == 's5') : ?>
<div class="icon-box-circular">
<div class="ib-icon"><i class="<?php echo $commet['fb-icon']; ?>"></i></div>
<div class="ib-content">
<p><?php echo $commet['fb-cont']; ?></p>
</div>
</div>
<?php elseif ($commet['fb-style'] == 's6') : ?>
<div class="icon-box-basic"><i class="<?php echo $commet['fb-icon']; ?>"></i>
<h4><?php echo $commet['fb-title']; ?></h4>
<p><?php echo $commet['fb-cont']; ?></p>
</div>
<?php else : ?>
<div class="icon-box-small <?php echo $commet['fb-style']; ?> mb-25"><i class="<?php echo $commet['fb-icon']; ?>"></i><span class="back-icon"><i class="<?php echo $commet['fb-icon']; ?>"></i></span>
<hr>
<h4><?php echo $commet['fb-title']; ?></h4>
<p><?php echo $commet['fb-cont']; ?></p>
</div>
<?php endif; ?>
<?php
return ob_get_clean();
}
add_shortcode('commet_featured', 'commet_featured');
vc_map([
'name' =>'Commet Featured Box',
'base' =>'commet_featured',
'icon' =>get_template_directory_uri(). '/images/cat.png',
'description' =>'Commet Custom box',
'params' =>[
[
'param_name' => 'fb-style',
'type' =>'dropdown',
'heading' =>'Featured Box',
'value' =>[
'select' =>' ',
'style 1' =>' ',
'style 2' =>'boxed ',
'style 3' =>'outlined ',
'style 4' =>'s4',
'style 5' =>'s5',
'style 6' =>'s6',
]
],
[
'param_name' => 'fb-icon',
'type' =>'iconpicker',
'heading' =>'Icon',
],
[
'param_name' => 'fb-title',
'type' =>'textfield',
'heading' =>'Title',
],
[
'param_name' => 'fb-cont',
'type' =>'textfield',
'heading' =>'Content',
],
],
]);
?>
.........................................................
No comments