
-
AuthorPosts
-
November 23, 2015 at 5:56 pm #541056
Hi,
New enfold user here. I have CPT that I’d like to create single-*.php for. I copied single-portfolio, rename & modify and it works so far
How can I render different element from avia advanced editor in php code. An example would be render testimonial element where each testimonial is rendered in a for loop through an array of strings.
I tried calling
`
echo ‘<div class=”entry-content” ‘.avia_markup_helper(array(‘context’ => ‘entry_content’,’echo’=>false)).’>’;
echo do_shortcode(“[av_testimonials style='grid' columns='2' interval='5' font_color='' custom_title='' custom_content='']
.. for loop goes here…
[/av_testimonials]“);
echo ‘</div>’;and it prints the shortcode outside the div, which may be a bug in enfold. Plus, it’s really difficult to output a bunch of shortcode this way.
If someone can point in the direction, i can dig through code without much problems. Thanks
November 23, 2015 at 10:26 pm #541211Hi webmons!
If your trying to change how the shortcode works then you will need to edit the PHP files. You could also create a copy of the shortcode file and change it however you like to create your own shortcode.
If you want to use it in the layout builder then you can do this, http://kriesi.at/documentation/enfold/enable-advanced-layout-builder-debug/, to add extra content.
Cheers!
ElliottNovember 23, 2015 at 10:54 pm #541237Elliot,
Thank you for the pointer.
Just want to confirm this. If I use advanced editor for 1 page and save it as a template. I then use that template in another page. If I come back and change the original page, the change won’t reflect in the 2nd page, will it?
If you want a template file that will apply to all CPT, you’d have to use theme files like I did but I’d have to create custom shortcode that wrap enfold if I want to change it behaviorsAny idea about why echo do_shortcode will output it outside of the main content even though the location of the echo is within the main content?
November 24, 2015 at 6:35 pm #541853Hey!
If it’s a full width element then it edits the layout a bit so you cannot use it inside do_shortcode. You could try echoing out some ending div tags to try and work around it.
echo '</div></div>';
Or something similar.
Cheers!
Elliott -
AuthorPosts
- You must be logged in to reply to this topic.