【发布时间】:2018-07-14 09:56:14
【问题描述】:
我有一个问题,自定义主题没有在自定义主题页面上加载插件文件。
切换到默认主题插件时,文件会在同一页面上正确加载。 我不确定我是否遗漏了一些东西,因为我可以找到强制性的所有动作钩子都包括在内。 任何指导或帮助将不胜感激,谢谢。
自定义主题页面设置如下:
header.php 内容:
<!doctype html>
<html lang="en-US">
<head>
<?php wp_head();?>
</head>
page-custom.php 内容:
<?php get_header(); ?>
<body>
<?php
// content
$content_post = get_post(125); // 125 equals id of the custom page
$content = $content_post->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
// footer
get_footer();
?>
footer.php 内容:
<?php
wp_footer();
?>
</body>
</html>
【问题讨论】:
标签: wordpress wordpress-theming custom-wordpress-pages