Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add id to an element in visual composer

I've been trying to figure out how to add an ID to a visual composer element, but I can't figure out how to do so. I've tried editing the row, but the only options I have are Custom CSS Class, Parallax, Full Width and Font Color, but no ID everywhere. I've tried putting id="something" and Id="something" into the shortcode with no good luck.

I need to do this in order to make links to some rows within the same page. If there's another workaround to that, I'm eager to know.

Thanks in advance for any response.

like image 524
Jose Daniel Chacón Bogarín Avatar asked Sep 11 '14 21:09

Jose Daniel Chacón Bogarín


4 Answers

el_id

Use el_id='something'.


Shortcode example:

[vc_row el_id='something'] CONTENT [/vc_row]


It wil be generated like this into the DOM:

<div id="something" class="vc_row wpb_row vc_row-fluid">

like image 152
Tudor Avatar answered Oct 16 '22 08:10

Tudor


I had to solve it also, what I did was to create an "Raw html" module, and add the ID on it:

<div id="section"><div>

and place it above the section you want to link to.

Hope it helps!

like image 30
DiegoFreelancer Avatar answered Oct 16 '22 10:10

DiegoFreelancer


This work for me: for add a id to row you can aloso add this code in your function.php theme file:

$attributes = array(
'type' => 'textfield',
 'heading' => "HTML ID",
 'param_name' => 'element_id',
 'value' => '',
 'description' => __( "Assign an ID to the row", "discprofile" )
);

vc_add_param( 'vc_row', $attributes );

After if you edit a row you find a new input element titled Html ID.

Source: https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524335

like image 1
kampageddon Avatar answered Oct 16 '22 10:10

kampageddon


Visual Composer now has a Row ID field. Since v4.5 I believe.

like image 1
Dan Avatar answered Oct 16 '22 08:10

Dan