【发布时间】:2013-03-09 14:06:46
【问题描述】:
我想知道如何做到这一点。我有这个代码:
// Text
function login_styles() {
echo '<style type="text/css">h1 a { background:url('. get_bloginfo("template_directory") .'/images/din_logo.png) no-repeat center top; }</style>';
}
add_action('login_head', 'login_styles');
这是一个 WordPress 主题的函数,应该在“functions.php”中。但是当我想将它插入到帖子中以在我的博客上分享时,它不会显示:style type="text/css 等。样式标签内的整个代码都不会显示。
为了显示我在帖子中使用 pre 标记的代码。似乎不会显示标签中的标签?为什么会这样?
【问题讨论】:
-
您是否在问为什么您的博客文章会呈现 html 标签? php.net/htmlentities
-
您能否粘贴实际的 html 输出内容,然后再粘贴您想要的内容?我无法从您的问题中推断出这一点。
-
我希望这可以工作,但没有,jsfiddle.net/kjDc4
-
@marcuscvj 您应该只编辑您的答案以包含该输出,而不是将其放在评论中,作为评论很难阅读
-
@AshBurlaczenko
标签不会阻止其他标签正常呈现
标签: php html wordpress styles pre