我在我的 wordpress 主题中乱搞,loop_single.php
以小写形式输出帖子标题。
我的内容有non-ascii
字符,所以我认为以下内容会起作用:
<?php echo mb_strtolower(the_title()); ?>
但它不起作用。它只是以书写方式输出标题。
我在我的 wordpress 主题中乱搞,loop_single.php
以小写形式输出帖子标题。
我的内容有non-ascii
字符,所以我认为以下内容会起作用:
<?php echo mb_strtolower(the_title()); ?>
但它不起作用。它只是以书写方式输出标题。
你试过了吗
<?php echo mb_strtolower(the_title(),'UTF-8'); ?>
只使用 CSS 怎么样?
h1.post-title { /* or whatever the selector is */
text-transform: lowercase;
}
如果将来有其他人出于非 CSS 相关的原因尝试执行此操作,此链接将非常有帮助。
https://wordpress.stackexchange.com/questions/39145/how-do-i-convert-a-pages-title-to-lower-case
get_the_title($post->ID); 优于 the_title(); 在这种情况下。