How does zblog modify the SEO title of the website article page

Li Yang's Blog 2020-02-24 1.71 W Reading 0 Comments

Tips: This article has exceeded one thousand five hundred and fifty-five No update in days, please note whether relevant content is still available!

Recently, several friends have reported that the current SEO title is different from the previous website template, which may lead to the deletion of the previous collection. They asked me to modify the topic's SEO title according to their original SEO scheme, which I rejected directly. Because the blog template of the topic uses the SEO title writing method specified by the search engine, the topic template can only refer to the public, It cannot operate according to its personal S specification. Simple list Baidu A more standardized list of title SEO. For more details, please see the original text: Baidu Search Page Title Specification

For search users, the title is the most intuitive cognitive channel and presentation mode of the web page, and also the key factor to attract users to click the search results to enter the landing page.

 How does zblog modify the first SEO title of the website article page

In order to ensure that search users can effectively obtain the resources they need and ensure the fairness of the search results, Baidu Search has released the Baidu Search Page Title Specification to meet the needs of users stationmaster Bring more traffic and achieve win-win results.

The composition of the title is as shown in the figure: pay attention to the red area, which is the suggested title format.

 How does zblog modify the second SEO title of the website article page

Then check whether the title of this website corresponds to the SEO title suggested by Baidu:

Home page:

 How does zblog modify the third SEO title of the website article page

Classification list (list):

 How does zblog modify SEO title page 4 of the website article page

Article Details (Content) Page:

 How does zblog modify the SEO title page 5 of the website article page

To sum up, all the theme templates developed by this website are in line with the SEO specification. Moreover, the theme templates have been launched for application. Throw away the newly launched ones, and there are no fewer users of other themes. If we uniformly modify the SEO prevention, we can imagine what the consequences will be.

However, for some customers, what should we do if the existing scheme is inconsistent with the previous scheme? Today, I will teach you how to modify the SEO title:

Open the header.php template. Take the koi theme as an example. The template path is:/zb_users/theme/template name/template/. After opening the template, we will find the page judgment of the zb template, and find the page you want to modify. The page judgment is as follows: the code for each theme judgment is basically the same.

zblog Page judgment code:

 {if $type=='index '&&$page=='1'}/* Judge the first page*/ {if $type=='category '}/* Judge the category page*/ {if $type=='article'}/* Judge log page, not including independent page, {if $article. Type==ZC_POST_TYPE_ARTICLE} (another scheme)*/ {if $type=='page '}/* Judge independent pages*/ {if $type=='author '}/* Judge user page*/ {if $type=='date '}/* Judge the date page*/ {if $type=='tag '}/* Judge the tab*/

To modify the article page, we open the template:/zb_users/theme/koilee/template/header. php

Find the page judgment interface, as shown in the figure:

 How does zblog modify the 6th SEO title of the website article page

Inside the red box is the title of the article page (content page), as follows:

 {$title} - {$article.Category.Name} - {$zbp->Config('koilee')->webtitle}

The foreground display effect is "website title - article category - website name" {$zbp->Config('koilee')->webtitle} Customize the SEO interface for the theme. Some themes may use {$name} For example, if we want to delete the category of the article, we just want to display the title of the website article and the website name. After modification, it is as follows:

 {$title} - {$name}

Here's why it's not applicable“ $zbp->Config('koilee')->webtitle ”Interface, because this is the Koi theme argument interface, which is only applicable to Koi, and other themes will make errors. Therefore, it is recommended to use the official website title interface after modification, website settings basic settings website title, as shown in the figure below:

 How does zblog modify the 7th SEO title of the website article page

Save the php file after modification (the php file cannot be opened with its own txt text. It is recommended to use EditPlus , or the Application Center can search for "Theme Edit" and use it directly plug-in unit Edit), background home page, click“ [Clear cache and recompile template] ”Then open the website article page to see the effect.

 How does zblog modify the 8th SEO title of the website article page

Other pages are modified in the same way. You can check the page by yourself, with special instructions:

  1. Remember before modification backups Theme template.

  2. modify Not directly applicable to txt text editor

  3. After modification Clear the theme cache and recompile the template Can take effect (if your site has enabled the development mode, this cannot be ignored, but normally it is not recommended to enable this item, and developers are only for development and testing).

Article copyright notice: unless otherwise noted Lao Li's Notes For original articles, reprints or copies, please use hyperlinks and indicate the source.

Comment

Quick reply: expression:
 Addoil Applause Badlaugh Bomb Coffee Fabulous Facepalm Feces Frown Heyha Insidious KeepFighting NoProb PigHead Shocked Sinistersmile Slap Social Sweat Tolaugh Watermelon Witty Wow Yeah Yellowdog
Comment List (No comment yet, seventeen thousand one hundred and seven People around)

No comment yet, let me say something

 cancel
 WeChat QR code
 WeChat QR code
 Alipay QR code