0
votes

I created custom template "contact.php"

contact template
 <?php if (have_posts()) : while (have_posts()) : the_post();?>
  <?php the_content(); ?>
 <?php endwhile; endif; ?>

And I created a page called contact has only a shortcode in content

[wpgmza id="1"]

I set template of this page to contact But I can't see shortcode in real webpage and I don't know the reason. I tried to call do_shortcode('[wpgmza id="1"]') in template but it also doesn't work. enter image description here enter image description here Any advice will be big help. Thanks :)

1

1 Answers

0
votes

You probably need to add echo. Reference: https://developer.wordpress.org/reference/functions/do_shortcode/

echo do_shortcode( '[wpgmza id="1"]' );