By default, the title of a blog based on WordPress is defined within a theme with a code like the following (Please note: talk about the blog title rather than that of individual posts):
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;"><title></span> <title></span>
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;"><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></span> <? Php bloginfo ('name');?> <? Php if (is_single ()) {?> »Blog Archive <? Php}?> <? Php wp_title ();?></span>
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;"></title></span> </ Title></span>
Now, you want to associate different titles to different pages and leave the task to the blog engine to do this automatically, in which case you can use a code like the following:
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;"><title></span> <title></span>
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;"><?php if (is_home () ) { bloginfo('name'); }</span> <? Php if (is_home ()) {bloginfo ('name');}</span>
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;">elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo('name'); }</span> elseif (is_category ()) {single_cat_title (); echo '-'; bloginfo ('name');}</span>
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;">elseif (is_single() ) { single_post_title();}</span> elseif (is_single ()) {single_post_title ();}</span>
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;">elseif (is_page() ) { single_post_title();}</span> elseif (is_page ()) {single_post_title ();}</span>
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;">else { wp_title('',true); } ?></span> else {wp_title ('', true);}?></span>
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;"></title></span> </ Title></span>
This particular change is ideal for those looking for your blog a better level of optimization for search engines.
Related posts:
- Titles in PHP permalink
- Using the conditions for query UPDATE
- Update the URL of the domain in the WordPress database
- Make a URL with cURL
- Validate the value of a hex color with PHP
- Restrict input length of the DB field to park
- Cycling an empty array in PHP
- Enable Code Execution in PHP files without extensions
- Enter PHP in JavaScript
- Calculate the size of a MySQL database