-
AuthorPosts
-
September 8, 2015 at 9:00 am #499720
Dear Support!
First of all let me thank you the excellent work with enfold template. It’s really imressive.
We would like to run PHP code in codeblock or in a part of a pade within enfold. The best way would be codeblock due to the great visual editor function. We saw that there is a possibility to run js, css and html in codeblock, but how is it possible to run php in it?What is the easiest was for eg. to put a captcha in a login form made in codeblock in enfold?
Many thanks,
FerencSeptember 8, 2015 at 12:33 pm #499792Hey!
Not possible, i’d suggest you using a custom shortcode:
https://codex.wordpress.org/Shortcode_APICheers!
JosueSeptember 9, 2015 at 11:08 am #500299Thank you!
A strange thing has happened. I Added JS into codeblock and suddenly the editor crashed.
Originally I had html and css in codeblock which generated a pretty good form on the website
Now as I added the js, the editor can not handle it. How can I reverse and fix it? Please help.Original editor: http://kepfeltoltes.hu/150909/ScreenHunter_51_Sep._09_11.02_www.kepfeltoltes.hu_.jpg You can see here the codeblock and it is okay, the code is there and works properly.
Current editor: http://kepfeltoltes.hu/150909/ScreenHunter_50_Sep._09_10.56_www.kepfeltoltes.hu_.jpg Somehow the content from codeblock is generated in editor view and editing is impossible. Codeblock is empty, the content is placed in text block and is not editable…
Regards,
FerencSeptember 10, 2015 at 1:13 am #500784Unfortunately that was expected, currently, the code block doesn’t support
textarea
elements, i’d suggest you using a shortcode approach instead, something like this (place this code in your theme / child theme functions.php):function custom_shortcode_func() { ob_start(); ?> PUT YOUR CODE HERE <?php $output = ob_get_clean(); return $output; } add_shortcode('my_shortcode', 'custom_shortcode_func');
Then to use it in your Pages:
[my_shortcode]
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.