Provide zblog template_zblog them_wordpress template download and customization

The Method of Adding Keyword Description to Zblogphp Article Content Page

Tianxing Studio 2014-06-11 20:12 course eleven thousand nine hundred and thirty-three 3 Comments


This is a Tianxing Studio The template user asked a question. Because he couldn't explain clearly in one sentence and two sentences, he wrote this article.

In advance, zblogphp now has a plug-in“ Title seo ”It is easy to set the descriptions and keywords of all zblogphp pages, but the user said that the keywords and descriptions added after using this plug-in were not below the page title and went to<body>. In fact, this is not a big problem, but it would be bad if he met a friend with obsessive-compulsive disorder, So if you want to use another method to modify the template source file directly, please continue to read the following content.

PS: I wrote an article on this website before“ The method of adding keywords and descriptions to zblogphp website ”, but this is a way to add keywords and descriptions to the zblogphp homepage.

The steps to add keywords and descriptions to the zblogphp article content page are as follows:

  1. Find the header template file "header. php", copy all the code inside and create a new "header1. php" file. Paste all the code just copied here and save it;

  2. The template called by the article page is "single. php". Then find the file, open it and see that the first line of code is "{template: header}", which is modified to "{template: header 1}";

  3. ok, Next, modify the newly created "header1. php" file, find the code "<title>{$name} - {$title}</title>" here, and add the following code below:

 <meta name="keywords" content="{foreach $article.Tags as $tag}{$tag.Name}{/foreach}" />     <meta name="description" content="{$article. Title} is an article about {foreach $article. Tags as $tag} {$tag. Name} {/foreach} in {$name}. Welcome to read and comment, {$subnet}"/>

OK, save it, update the cache in the background, and it is OK.


Next, let's introduce the meaning of the above code:

The keywords called by the above code are the tags filled in when publishing articles, and the description called is "article title/yes/website title/an article about/article tag/, welcome to read and comment,/website subtitle/"

Why do you write this way? The first is to increase the keyword density of the page, which is conducive to seo In fact, the description can also call the summary of the article. We only need to modify the code described below:

"<meta name=" description "content=" {$article. Title} is an article about {foreach $article. Tags as $tag} {$tag. Name} {/foreach} in {$name}. Welcome to read and comment, {$subname} "/>" change it to "<meta name=" description "content=" {$article. Intro} "/>".

But there is a problem with calling the article summary. If your summary contains html code, it will make an error. So if you want to describe your friends who want to call the article summary on the article page, please remember to set it in the summary when you publish each article, clear all html codes, and change the summary to the text you want.

Well, that's all. Those who don't know how to find the file "header. php" recommend reading it“ How to modify the zblog theme? Zblogasp topic modification method ”, and other questions are welcome to ask in the comment area at the bottom of the text, and will be answered when you have time.


Can't find a tutorial that can solve your problem?

You can try to search or ask questions directly online. We also provide charging technical support. If you need it, you can contact us online.

Online questions Online Service

yes three Comments from netizens:

  •  A rainy night

    A rainy night 10 years ago (2014-06-16) reply

    Download and use keyword? Now this search engine is not popular with him. Now most websites have basically abandoned it.

    •  meijie5523

      meijie5523 10 years ago (2014-06-17) reply

      I also don't want to use the problem that many customers have to do this.

      •  A rainy night

        A rainy night 10 years ago (2014-06-17) reply

        All right, customer first, hehe.

welcome you Comment: Cancel Reply

 Please fill in the verification code
  • Latest articles
  • Hot article ranking
  • Most Comments
Label aggregation