Wordpress如何在模板中调用短代码

there's a plugin for Contact us form[http://wordpress.org/plugins/contact-us-form/]

to activate the form all you have to do is to place [CONTACT-US-FORM] in the page................... Question My page is calling a page Template. Is it possible to add [CONTACT-US-FORM] Shortcode in the php template? I tried it and it did not work

Thanks

wordpress page worked, but not the method I want

[CONTACT-US-FORM]

php Contact Us template I want to try something like this but did not work

<?php
/*
Template Name: [contact us]

*/
get_header(); ?>
[CONTACT-US-FORM]
<?php get_footer(); ?>
echo do_shortcode('[CONTACT-US-FORM]');

use this in your template

Look here for more Do Shortcode

Try this:

<?php 
/*
Template Name: [contact us]

*/
get_header();
echo do_shortcode('[CONTACT-US-FORM]'); 
?>

// Use shortcode in a PHP file (outside the post editor).

echo do_shortcode( '' );

// Use shortcodes in form like Landing Page Template.

echo do_shortcode( '[contact-form-7 id="91" title="quote"]' );

//Same Way

echo do_shortcode('[CONTACT-US-FORM]');

Please just go through the reference link [Link]

Make sure to Enable the use of shortcodes in text widgets. To do so, add this in your functions.php file

add_filter( 'widget_text', 'do_shortcode' );

and then you can use in any php file:
<?php echo do_shortcode('[YOUR-SHORTCODE-NAME/TAG]'); ?>

check the docs for more
https://developer.wordpress.org/reference/functions/do_shortcode/