Current location - Recipe Complete Network - Complete cookbook - How to modify the wordpress blog title to: the source code of the first page shows the title of the main keyword of the website, and the source code of the inner page only shows the title of the inner
How to modify the wordpress blog title to: the source code of the first page shows the title of the main keyword of the website, and the source code of the inner page only shows the title of the inner
How to modify the wordpress blog title to: the source code of the first page shows the title of the main keyword of the website, and the source code of the inner page only shows the title of the inner page. Seo plug-in is not good. This question should have been answered a long time ago, just for keywords and descriptions. Add your own title. The method is as follows:

I tried it, and it all worked.

/% BA % BC % D6 % DD % C0 % EE % CF % E9/blog/item/a 42 DCC 2606 c 0 CCE 199250 af 2 . html

1. Find the header.php file in the theme directory in the root directory of the website you installed, usually in the background. Find the following code

meta http-equiv = " Content-Type " Content = " text/html; charset=UTF-8" /

Add the following calling code below.

& lt? php if (is_home()) {? & gt

& ltMeta name="keywords" content= "keywords of your website"/>

& ltmeta name = " description " content = " description of your website "/& gt。

& ltlink rel = " canonical " href = " & lt? PHP echo get _ settings(' home '); ? >/& gt;

& lt? php }? & gt

& lt? php if ( is_single() ) {? & gt

& ltmeta name = " keywords " content = " & lt; ? php $ key = " keywordsecho get _ post _ meta($ post-& gt; ID,$key,true); ? >/& gt;

& ltmeta name= "description" content = "< php $ key = " descriptionecho get _ post _ meta($ post-& gt; ID,$key,true); ? >/& gt;

& ltlink rel = " canonical " href = " & lt? PHP echo get _ permalink($ post-& gt; ID); ? >/& gt;

& lt? php }? & gt

2. Modification: The keyword of your website is the keyword you want on your homepage, and the description of your website is the description of your website. Determine the keywords and description of the home page.

Used for article pages. You need to call the custom column to open the display option in the upper right corner of the background page (normally compressed). Check the custom column.

Add two custom columns (because the code above has been commented. If it is an article page, call the keywords and descriptions in the custom fields:

Name one: keyword value one: the page keywords you need.

Name two: descroption value two: required page description.