1

I have a row elements and 3 columns inside :

[row]
[one_third]1[/one_third]
[one_third]2[/one_third]
[one_third]3[/one_third]
[/row]

How can I add a custom class or id to [row] element ? I need to squeeze cols 1 and 3 closer to 2 by modifying their margins.

1

You could abandon the shortcodes and use HTML.

<div class="row full-width whatever">
[one_third]1[/one_third]
[one_third]2[/one_third]
[one_third]3[/one_third]
</div>

OR

you could easily just wrap all of your code in another div and target the [row] element through CSS:

<div class="your_special_wrapper">
[row]
[one_third]1[/one_third]
[one_third]2[/one_third]
[one_third]3[/one_third]
[/row]
</div>
<style>
.your_special_wrapper div{ /*whatever css you need*/ }
</style>
  • while your answer is pretty better than the following "add a parameter class to the shortcode column" it makes the thread a pure HTML/css question – JMau May 6 '14 at 20:32
  • That is true, but the question was probably made under the assumption that whatever plugin/theme created the [row] shortcode may have a specific Wordpress way of handling classes. – Douglas.Sesar May 6 '14 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.