fency heading shortcode with visual composer
fency heading shortcode:-
==========================================================================================
html code:-
..................
<div class="title center">
<h4 class="upper">We are driven by creative.</h4>
<h2>Who We Are<span class="red-dot"></span></h2>
<hr>
</div>
<div class="section-content">
<div class="col-md-8 col-md-offset-2">
<p class="lead-text serif text-center">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt sed ad possimus magnam maiores. Ipsam quas velit blanditiis debitis consequuntur mollitia assumenda nam obcaecati illo! Dolores deleniti animi.</p>
</div>
</div>
.................................
<?php
function commet_fency_head($one, $two){
$commet = shortcode_atts([
'title' =>' ',
'subtitle' =>' ',
'f-content' =>' ',
'f-align' =>' ',
], $one);
ob_start();
?>
<div class="title <?php echo $commet['f-align']; ?>">
<h4 class="upper"><?php echo $commet['subtitle']; ?></h4>
<h2><?php echo $commet['title']; ?><span class="red-dot"></span></h2>
<hr>
</div>
<div class="section-content">
<div class="col-md-8 col-md-offset-2">
<p class="lead-text serif text-center">
<?php echo $commet['f-content']; ?>
</p>
</div>
</div>
<?php
return ob_get_clean();
}
add_shortcode('commet_fency_head', 'commet_fency_head');
vc_map([
'name' =>'Commet Fency Heading',
'base' =>'commet_fency_head',
'icon' =>get_template_directory_uri(). '/images/cat.png',
'description' =>'Commet Custom box',
'params' =>[
[
'param_name' => 'title',
'type' =>'textfield',
'heading' =>'Title',
],
[
'param_name' => 'subtitle',
'type' =>'textfield',
'heading' =>'Sub Title',
],
[
'param_name' => 'f-content',
'type' =>'textarea',
'heading' =>'Content',
],
[
'param_name' => 'f-align',
'type' =>'dropdown',
'heading' =>'Alignment',
'value' =>[
'Left' =>'left',
'Right' =>'right',
'Center' =>'center'
]
],
],
]);
?>
...................................................
No comments