Subway WordPress Visual Composer Update

Just a short note to the Visual Conmposer how to included link with the icon-list modul. in  he Subway WordPress Theme some nice extra functions who make it much user friendly.

The list icon modul dont support to add links , with some lines of   code we can add the option to link the Icon List item  module.

These blogpost is also a reference for later on if the theme get updated .

Following Files need to be edited you find them in subway/include and extendvc directory

Finally we mode the short code function to include the $link in short code shortcodes.php

/* Icon List Item shortcode */
/* METAMODE */
if (!function_exists('icon_list_item')) {
function icon_list_item($atts, $content = null) {
extract(shortcode_atts(array("icon"=>"", "icon_color"=>"", "icon_background_color"=>"", "icon_border_color"=>"", "title"=>"", "link"=>"","title_color"=>""), $atts));
$html = '';
$html .= '<div class="icon_list">';
$html .= '<i class="'.$icon.' pull-left icon-border" ';
if($icon_color != "" || $icon_background_color != "" || $icon_border_color != ""){
$html .= 'style="';
if($icon_color != ""){
$html .= 'color:'.$icon_color.';';
}
if($icon_background_color != ""){
$html .= 'background-color:'.$icon_background_color.';';
}
if($icon_border_color != ""){
$html .= 'border-color:'.$icon_border_color.';';
}
$html .= '"';
}
$html .= '></i>';
$html .= '<p';
if($title_color != ""){
$html .= ' style="color: '.$title_color.';"';
}
$html .= '><a href="'.$link.'">'.$title.'</a></p>';
$html .= '</div>';
return $html;
}
}

 

Add the Form Label in : qode_shortcodes_icon_list_item.php

<div class="input">
<label>Link</label>
<input name="link" id="link" value="" maxlength="100" size="55" />
</div>

We add the extra array into  our new Link in extend-vc.php to extend the parameter for //Icon List Item
vc_map( array

//Icon List Item METAMODE

vc_map( array(  .....

array(
"type" => "textfield",
"holder" => "div",
"class" => "",
"heading" => __("Link"),
"param_name" => "link",
"value" => $link,
"description" => __("")
),



 


Code Cowboy

Exploring and Notes about interesting code snipets

Leave a Reply

Your email address will not be published. Required fields are marked *