Tagged: Codeblock
-
AuthorPosts
-
October 20, 2014 at 6:09 am #338137
Hi,
When I add a PHP code snippet into an Avia code block it doesn’t get executed because Avia somehow converts PHP code into a HTML comment markup. Why so?Input:
[av_codeblock wrapper_element='' wrapper_element_attributes='' custom_class=''] <div class="white-popup mfp-hide" id="plan-popup"> ... [av_row row_style='avia-heading-row'][av_cell col_style='']Individual Plan[/av_cell][av_cell col_style='']Business Plan[/av_cell][/av_row] [av_row row_style='avia-pricing-row'][av_cell col_style='']<strong><?php print(get_field('price_individual', get_the_ID())); ?></strong>$<small>per month</small>[/av_cell][av_cell col_style='']<?php print(get_field('price_business', get_the_ID())); ?>$<small>per month</small>[/av_cell][/av_row] ... </div> [/av_codeblock]
Output:
... <li class="avia-pricing-row"><!--?php print(get_field('price_individual', get_the_ID())); ?--><span class="currency-symbol">$</span><small>per month</small></li> ...
- This topic was modified 10 years, 1 month ago by epresley.
October 20, 2014 at 9:51 pm #338672Hi epresley!
Please try using this plugin – https://wordpress.org/plugins/insert-php/
Best regards,
YigitOctober 22, 2014 at 12:50 am #339290Now it looks as follows:
Output:
<li class="avia-pricing-row">[insert_php] print(get_field('price_individual', get_the_ID())); [/insert_php]
It still doesn’t process PHP code and I did not disable shortcode processing…
Besides: I use another plugin called ExecPHP which also executes PHP code snippets and it all works except inside an avia codeblock…October 22, 2014 at 6:36 pm #339651October 24, 2014 at 6:56 am #340469Yes, I have. Just inside a text block it gets executed but as soon as this one is wrapped into an avia code block the shortcode doesn’t get executed.
October 24, 2014 at 7:00 am #340471This reply has been marked as private.October 25, 2014 at 5:20 am #340897Hi!
Thank you for the update.
You can’t use php codes inside the code block element and shortcodes are not recommended as you can see on the note:
Enter some text/code. You can also add plugin shortcodes here. (Adding theme shortcodes is not recommended though)
The get_field function is not a native theme function. Did you get this from advance custom fields plugin? Please contact the plugin author regarding the issue. I’m sorry but we don’t provide support for third party plugins.
Regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.