【发布时间】:2017-12-04 10:57:11
【问题描述】:
我通过它的 ID 将帖子插入到模板 (footer.php) 中,但我只从帖子中获取原始文本。缺少 html 标签和其他所有内容。我用这个试过了
<?php
$post_id = 32;
$queried_post = get_post($post_id);
$title = $queried_post->post_title;
echo $title;
echo $queried_post->post_content;
?>
还有一个带有简码和插件的。结果相同。 我需要 html 标记和所有内容,因为该站点是使用站点构建器(elementor)构建的,并且内部有一些进度条。
有什么想法吗?这甚至可能吗?
【问题讨论】:
-
检查你的functions.php中有这个“wp_strip_all_tags”过滤器
-
谢谢,但不,不使用。
标签: wordpress templates post insert themes