1. Home
  2. Insert PHP Code Snippet
  3. FAQ
  4. Can I embed the PHP Snippet into my template file?

Can I embed the PHP Snippet into my template file?

Yes, you can embed the PHP Snippet into your template file.

You cannot directly add the shortcode in the template file but you will need to pass the code into do_shortcode()function and display its output like this:

<?php echo do_shortcode( '[xyz-ips snippet="Test"]' ); ?> 

Note: Instead of [xyz-ips snippet="Test"] please use your PHP snippet shortcode.

Was this article helpful to you? Yes 1 No 1