Tagged: html
-
AuthorPosts
-
February 22, 2024 at 8:29 pm #1435154
Hi there –
Whenever I add an HTML code block and update the page, I get the spinning wheel circle and am no longer able to edit the HTML of the page. Is there a solution for this? I need to be able to edit the page…
Currently testing on staging site, but will replicate on live site once we have a solution.
Thanks,
SophiaFebruary 23, 2024 at 7:03 am #1435159Hey sophiasbiti,
Thank you for the inquiry.
Are you inserting scripts or input tags within the Code Block element? Please note that such tags could break the builder’s functionality and are not recommended. You might have to create a custom shortcode for handling these script and input tags, instead of adding them directly to the builder.
// https://codex.wordpress.org/Shortcode_API
Best regards,
IsmaelFebruary 23, 2024 at 4:45 pm #1435226Thanks, Ismael. I will try creating a shortcode for it. Are there any recommended plugins that could do this for me? I’m thinking of using https://wordpress.org/plugins/shortcoder/
Thank you!
February 26, 2024 at 9:58 am #1435406Hi,
Thank you for the update.
Yes, you can use the plugin but you can also do it manually in the functions.php file.
Example:
function av_custom_input_script_shortcode($atts) { $atts = shortcode_atts( array( 'type' => 'text', 'placeholder' => '', 'script' => '', ), $atts ); $type = esc_attr($atts['type']); $placeholder = esc_attr($atts['placeholder']); $script = esc_js($atts['script']); $output = '<input type="' . $type . '" placeholder="' . $placeholder . '" />'; $output .= '<script>' . $script . '</script>'; return $output; } add_shortcode('av_custom_input_script', 'av_custom_input_script_shortcode');In the builder, you can use this shortcode:
[av_custom_input_script type="text" placeholder="Enter your text" script="alert('Input submitted');"]Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.
