Roll-your-own and custom VC element
-
Hi there,
I’m trying to create a custom Visual Composer element based on your plugin. I’m using roll-your-own way because I didn’t find a proper way to pass the variables in the shortcode, being put into the php code of template.
I don’t know if there is a way to dynamically assign unique id to each element, but at the moment same ids on multiple divs cause them to behave like this.
https://pdidner.staging.wpengine.com/14628-2/The first one is collapsed by default, but any other element is expanded and if you click on any of them – the first will expand and the other 3 will collapse, as if they were in a group.
Maybe you can help me to find a proper way to keep them all separated and collapsed by default.
<div id="test_event" class="collapseomatic"> <h3 class="vc-event-title">' . $title . '</h3> <p><strong>' . $location . '</strong></p> </div> <div id="target-test_event" class="collapseomatic_content">' . $content2 .'<br> <a href="' . $link . '">Read More</a> </div>
another possibility would be something like
echo do_shortcode( '[expand title="Sith" trigclass="noarrow"]Target Content[/expand]' );
But I have 2 issues there:
it breaks php for some reason
Parse error: syntax error, unexpected 'title' (T_STRING), expecting ']'
I’m not sure how to properly pass the above variables in the shortcodeThank you in advance
The page I need help with: [log in to see the link]
- The topic ‘Roll-your-own and custom VC element’ is closed to new replies.