WordPress homepage only displays title or subtitle

Wordpress homepage i title display specified content

Refer to the following methods,

In the header.php Of

 <? php wp_head(); ?>

Add the following code before:

 <? php  if (is_home()){ echo '<title>' ; bloginfo ( 'description' ); echo  '</title>' ; } ?>
 Wordpress home page only displays title or subtitle

The answer is over. What if only the title is displayed?

The first page only displays the title, not the subtitle.

Today, I met a demand like the title, which is very wonderful, but I still did it. My method is to add a judgment code in header.php. If it is the home page, the title will be called and displayed. If it is not the home page, it will not be output.

In the header. php of the theme file

 <? php wp_head(); ?>

Add the following code before, refer to the figure above for the location.

The codes are as follows:

 <? php   if (is_home()){          echo '<title>' ;         bloginfo ( 'name' );          echo   '</title>' ;     }       ?>

The code is shown as follows:

 Wordpress home page only displays title or subtitle

Thus the requirement of title is realized.

The above is the method of not displaying subtitles on the home page

For reference only, I don't know if it has any impact on SEO.

course

API

2019-6-18 9:44:33

course

Output label description - Wordpress development

2019-6-26 9:42:55

⚠️
Some codes and tutorials on Npcink come from the Internet, and are only for netizens to learn and exchange. If you like this article, you can Attach original link Reprint at will.
No intention of infringing your rights, please send an email to 1355471563#qq.com Or click on the right Private message: Muze feedback, we will deal with it as soon as possible.
0 replies A Author M administrators
    There is no discussion yet. Tell me your opinion
Personal Center
Shopping Cart
Coupon
Sign in today
There are new private messages Private Message List
search