有没有办法在动态元标题中将一个单词大写?
基本上我在元标题中使用了一个 slug,但它是小写的。我只想将那个词大写,但我不确定这样做的最佳方式?
<title><?php $taxonomy = 'propertytype'; $queried_term = get_query_var($taxonomy);$term = get_term_by( 'slug', $queried_term, $taxonomy ); echo $term->slug; ?> the rest of the thitle goes here</title>
有没有办法把标题中的 slug 大写?
非常感谢
保罗
最佳答案
<?php
$taxonomy = 'propertytype';
$queried_term = get_query_var($taxonomy);
$term = get_term_by( 'slug', $queried_term, $taxonomy );
$cap = ucwords($term->slug);
?>
<title><?=$cap?>the rest of the thitle goes here</title>
关于css - 将动态元标题中的一个词大写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10384045/