How to adjust the title for every article in WordPress

Posted by Admin L in WordPress Experience on 10-03-2012.

Author: Nosa Lee
Original Address: https://www.seeksunslowly.com/adjust-wordpress-blog-title
To reprint this article, please indicate the source, thank you.
_____________________________________

The title format may not be to your satisfaction in current WordPress theme, if you want adjust it, please click “Appearance -> Editor -> Header (header.php)” in the control panel, and adjust the content between <title></title>

I use following title code and think it is good, for your reference.

[cc lang=”php”]
<br /> <?php /* * Print the <title> tag based on what is being viewed.<br /> */<br /> global $page, $paged;</p> <p>wp_title( ‘|’, true, ‘right’ );</p> <p>// Add the blog name.<br /> bloginfo( ‘name’ );</p> <p>// Add the blog description for the home/front page.<br /> $site_description = get_bloginfo( ‘description’, ‘display’ );<br /> if ( $site_description && ( is_home() || is_front_page() ) )<br /> echo ” | $site_description”;</p> <p>// Add a page number if necessary:<br /> if ( $paged >= 2 || $page >= 2 )<br /> echo ‘ | ‘ . sprintf( __( ‘Page %s’, ‘twentyeleven’ ), max( $paged, $page ) );</p> <p>?><br />
[/cc]

【赞赏 / Reward】

微信         支付宝         PayPal

Post a comment