【问题标题】:Wordpress plugin files do not load on custom themeWordpress 插件文件不会在自定义主题上加载
【发布时间】: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(']]>', ']]&gt;', $content);
echo $content;

// footer
get_footer();
?>

footer.php 内容:

<?php
wp_footer();
?>
</body>
</html>

【问题讨论】:

    标签: wordpress wordpress-theming custom-wordpress-pages


    【解决方案1】:

    我会查看插件的代码以查看它实际挂钩的内容,并确定主题在特定页面上加载的模板中是否缺少某些内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-03
      • 2015-09-17
      • 1970-01-01
      • 2022-08-16
      • 2021-10-13
      • 1970-01-01
      • 2012-04-11
      相关资源
      最近更新 更多