What to do if zblog template is incompatible with SEO plug-in

 talklee

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

HI, today I will talk about your most concerned problem, the SEO function of the theme, zblog One of the most popular plug-ins is the SEO plug-in. At first, I didn't know much about it, so I didn't touch it at first. But later, I got to know more about SEO and related knowledge. Referring to the existing specifications of SEO plug-ins and search engine titles, the theme template was directly prepared SEO optimization No matter the homepage, category or article, you can customize SEO information. I think that you can reduce your dependence on plug-ins. However, I am still too young.

 What to do if the zblog template is not compatible with SEO plug-ins Page 1

In the past six months, several netizens have reported that they have been using SEO plug-ins for a long time, and the theme is incompatible, so what they have included before may cause punishment. After all, even the title may not be right, so what should we do? At the beginning, I didn't understand that those children's shoes that thought SEO was awesome didn't follow the specifications, they had to follow their own writing, for example, the specification of article page title was“ Article name category name website name ”But he wrote it for you“ Article Name ”Another part is“ Article Name | Site Name ”Well, it is uneven, but recently I thought that it might have been used all the time. The weight has been included. If you change the SEO title, the previous efforts may be in vain. So today I will teach you how to solve the problem of incompatible themes with SEO plug-ins.

Cut the crap and find your theme template“ header.php ”Template, based on this site“ accomplish sth. lasting by leading a quiet life ”For example, find the theme template path“ /zb_users/theme/quietlee/template/ ”Edit“ header.php ”After finding the template, we will find the code as shown in the figure:

 What to do if the zblog template is not compatible with SEO plug-ins Page 2

These are SEO title information of homepage classification, articles and other templates Because the plug-in conflicts with these codes, there is nothing after the SEO plug-in is opened, and the website is directly displayed. Then we just need to delete these codes. Take the figure as an example, find“ {if $type==xxx} ”To {else} and {/if} End, as shown in the figure:

 What to do if zblog template is not compatible with SEO plug-in Page 3

The code starts to end, {if $type==xxx} -{/if} To prevent deletion errors, find {else} The first one below {/if} Label, delete. If you still don't understand, follow In the following, for example, this code means to judge each template page. The code is as follows:

 {if $type=='article '} Judgment Article page SEO {elseif $type=='page'} Article single page SEO {elseif $type=='index'} Homepage SEO {else} Other pages SEO (tags, searches, users, etc.) {/if}

You should be clear this time, right? from {if} starts to {/if} ends delete , and then to prevent errors, we paste the following code after deleting the code:

 <title>{if $type=='article' || $type=='page'}{$title}-{$name}{else}{$name}-{$title}{/if}</title>

Then save the code, return to the background home page, and click Clear cache and compile template , the foreground view effect. The same sentence, Remember to backup before modifying The PHP file cannot be used for txt text editing, otherwise an error will occur.

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

Comment

Quick reply: expression:
Comment List (Yes eight Comments, nineteen thousand and eighty People around)
 Netizen nickname: ending
Ending V tourist  Google Chrome 78.0.3904.108  Windows 10 x64 summer sleeping mat
2020-06-15 From Tianjin reply
https://681fp.cn/ Learned.
 Netizen nickname: talklee
talklee V Blogger  Sogou Explorer  Windows 10 x64
2020-06-16 From Tianjin reply
@Ending You're welcome~
 Netizen nickname: Zhang Bo Blog
Zhang Bo's Blog V tourist  Google Chrome 83.0.4103.97  Windows 10 x64 Bench
2020-06-11 From Shanghai reply
I think WP is easy to use...
 Netizen nickname: talklee
talklee V Blogger  Sogou Explorer  Windows 10 x64
2020-06-11 From Tianjin reply
@Zhang Bo's Blog Depending on which one to contact first, I'm not comfortable with either WP or Empire except ZB!
 Netizen nickname: a97313
a97313 V tourist  QQBrowser 10.5.3863.400  Windows 10 x64 chair
2020-06-08 From Shanghai reply
It's better to adapt to the theme directly and save the change
 Netizen nickname: talklee
talklee V Blogger  Sogou Explorer  Windows 10 x64
2020-06-09 From Shanghai reply
@a97313 Don't worry, it will fit!
 Netizen nickname: qq_5ypme8nt
qq_5ypme8nt V tourist  Google Chrome 78.0.3904.108  Windows 10 x64 sofa
2020-06-08 From Guangdong reply
The update is very timely
 Netizen nickname: talklee
talklee V Blogger  Sogou Explorer  Windows 10 x64
2020-06-08 From Shanghai reply
@qq_5ypme8nt Not bad, mainly because some netizens need to do a tutorial.

Contents [+]