我创建了一个以custom_page.php
wordpress 命名的自定义页面并将其用作页面模板。
我想创建自己的函数,并且只针对我的custom_page.php
. 此功能将作为插件安装。
我应该使用什么样的 WP HOOKS,例如我在下面有这个代码
function your_function() {
if ( is_page_template('custom_page.php') ) {
echo '<p>This is inserted at the bottom</p>';
{
}
add_action('wp_footer', 'your_function');
我只想在我的custom_page.php页脚区域中执行此代码。
[编辑]