开发者

custom title all over the pages on Wordpress

开发者 https://www.devze.com 2023-02-22 20:13 出处:网络
I want a specific title (<title>My Title!</title>) all over the pages of my website. If I just edit the header.php with <tit开发者_如何转开发le>My Title!</title> it doesn\'t wo

I want a specific title (<title>My Title!</title>) all over the pages of my website. If I just edit the header.php with <tit开发者_如何转开发le>My Title!</title> it doesn't work and display the default title of the Wordpress. how can I change it? I know there is a function wp_title() but I dont think it helps.

Thank you.


You just need to edit header.php. Are you sure youre editing the correct header.php file?

If you edit it under Appearance->editor->header.php in your admin youll be sure to be editing the correct one.


Look for wp_head in the header.php file... Removing the wp_head might cause you some other problems like a plugin not functioning well or so. Be careful with that, and i dont understand why u want to have the same title all over your site.


Include this to the header.php(after tag):

<title><?php if(is_home()) { echo bloginfo('name');  echo " - "; echo "Home";} else { 
echo wp_title(" - ", false, right); echo bloginfo(‘name’); } ?></title>
0

精彩评论

暂无评论...
验证码 换一张
取 消