动态元标题中的一个单词大写

问题描述 投票:0回答:1

有没有办法在动态元标题中将一个单词大写?

基本上我在元标题中使用了一个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大写?

非常感谢

保罗

css wordpress meta-tags capitalize
1个回答
0
投票
<?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>
© www.soinside.com 2019 - 2024. All rights reserved.