Site logo

Archived topic

Inserting shortcode inside html (elements)

3 replies · Started by g_younes on August 8, 2019

Viewing posts 1–4 of 4

Hello, I am just a bit confused as to how to add a shortcode inside HTML.
I am creating a custom footer through hooks in elements, and I want to place a form inside it from WPforms.
How am I supposed to add the shortcode inside the HTML? The online suggestions either say I should add the shortcode inside the page/post text (don't work in this case), or they provide a PHP suggestion (don't work in this case either as I am not dealing with template files).

Thank you.

Hi there,

is the shortcode not working at all? Or is it being output outside of the HTML?

Have you tried:

<?php echo do_shortcode("[the-shortcode]"); ?>

I just realized there are "execute shortcodes" and "execute PHP" options inside elements below the HTML section. I had totally missed them at first. Just now I checked them both and the shortcode worked. Thank you!

Aah yes :) Glad you got it resolved

This archived topic is closed to new replies.