Firefox Developer Edition Building up a Google Adwords campaign (2) – Starting the campaign
Design     Development     HTML5     Javascript     PHP     Visual Composer     WordPress    

Extending the Visual Composer Row element with a new property

7. November 2014

Visual Composer for WordPress provides many ways to extend its functionality. There are already many add-ons available for this dynamic page builder, but its easy to do the extending yourself,  by following the hints in the documentation 😉

In this small tutorial we are adding a “type” field to allow a special css class to be added to each of our row containers.

New Visual Composer element properties can be easily added by using the vc_add_param function. See documentation for more information. In our case we are adding a property to the vc_row element.


By adding the following lines to your themes functions.php, this new property will show in the admin row settings popup.

The new setting will be saved, when you save your document, but you wont see any changes on the frontend yet! Our goal is to switch a css class depending on the type we selected.

Each element within Visual Composer has its own template and these templates can be overruled using your own theme templates. In this case vc_row.php.

  1. Create a new folder “vc_templates” in your theme or child-theme.
  2. Copy vc_row.php from /wp-content/plugins/js_composer/includes/templates/shortcodes/ to your newly created folder.


The file contents should look something like this:


Now we are adding the magic from the backend to the frontend 🙂 This is how the altered version should look like in your theme folder

We added
‘type’ => ‘in_container’
to the shortcode parameter extraction, with a default setting.

We also added the resulting type to our row wrapper
$output .= ‘<div class=”‘.$type.’ ‘.$css_class

Visual Composer allows you to modify any of its elements that way and extend it with your own options or mighty extensions 😉 Visual Composer allows some nice custom tweaking, you just need to look a bit closer at the documentation, which is not always that simple to follow 🙂

Enjoy coding …

Leave a Reply

2 Comments on "Extending the Visual Composer Row element with a new property"

Notify of

Sort by:   newest | oldest | most voted
15 days 1 hour ago

Visual composer never was a smart thing. It’s crap, in fact.
Why make it so complicated?
What’s wrong with the good old CSS?
So easy to change any style, layout, etc., with plain CSS. With VC? Waste time and still can’t do what you “Really” want and otherwise could do with plain, straight forward CSS files.

VC is for idiots and poor hackers (fits WP overall purpose)