0

我在我的 wordpress 主题中乱搞,loop_single.php以小写形式输出帖子标题。

我的内容有non-ascii字符,所以我认为以下内容会起作用:

<?php echo mb_strtolower(the_title()); ?>

但它不起作用。它只是以书写方式输出标题。

4

3 回答 3

1

你试过了吗

<?php echo mb_strtolower(the_title(),'UTF-8'); ?>
于 2011-06-05T13:45:06.767 回答
1

只使用 CSS 怎么样?

h1.post-title { /* or whatever the selector is */
    text-transform: lowercase;
}

https://developer.mozilla.org/en/CSS/text-transform#Values

于 2011-06-05T13:46:11.727 回答
0

如果将来有其他人出于非 CSS 相关的原因尝试执行此操作,此链接将非常有帮助。

https://wordpress.stackexchange.com/questions/39145/how-do-i-convert-a-pages-title-to-lower-case

get_the_title($post->ID); 优于 the_title(); 在这种情况下。

于 2014-10-07T15:51:17.787 回答