Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1435595

    Hi,
    On the English version of my site, when I put code in a block of code, it disappears as soon as I save the page.
    On the French version (the first one I created), everything is OK.
    (I use WPML.)
    Thanks for your help.
    Eric

    #1435680

    Hey Eric,

    Thank you for the inquiry.

    What code are you trying to add to the Code Block element? Please post the code on pastebin.com. Also, please note that script or input tags can cause issues with the layout builder, so it’s not recommended to add them directly to the editor.

    Best regards,
    Ismael

    #1435741
    This reply has been marked as private.
    #1435828

    Hi,

    Thank you for the inquiry.

    You may need to create a custom shortcode for the html tag instead of adding it directly to the builder. Please add this code in the functions.php file:

    function avs_ctv_searchbar_shortcode( $atts ) {
        $html = '<ctv-searchbar></ctv-searchbar>';
        return $html;
    }
    add_shortcode( 'avs_ctv_searchbar', 'avs_ctv_searchbar_shortcode' );
    

    In the code block element, use this shortcode:

    [avs_ctv_searchbar]
    

    For more info, please check the documentation below:

    // https://codex.wordpress.org/Shortcode_API

    Best regards,
    Ismael

    #1435916

    Thank you very much Ismael for your solution. Everything is in order now thanks to you.
    Best regards, Eric

    #1435948

    Hi,

    Glad to now that this solution worked! Please feel free to open another thread if you have more questions about the theme.

    Have a nice day.

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Code disappear from blocks of code when saving page’ is closed to new replies.