Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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,
    Ferenc

    #499792

    Hey!

    Not possible, i’d suggest you using a custom shortcode:
    https://codex.wordpress.org/Shortcode_API

    Cheers!
    Josue

    #500299

    Thank 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,
    Ferenc

    #500784

    Unfortunately 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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.