Provide zblog template_zblog them_wordpress template download and customization

The method of adding keywords and descriptions to zblogphp website

Tianxing Studio 2014-03-11 17:12 course forty-one thousand three hundred and seventy-eight 5 Comments


Ps: Now zblogphp has released a seo plug-in, which is more convenient to solve this problem, so please read it directly " The seo plug-in of zblogphp: title SEO "OK.

Maybe many friends are used to setting keywords and describing these seo steps after the website is set up. Tianxing Studio has introduced the method of adding keyword descriptions to zblogasp before: Zblog adds the method of modifying website keywords and descriptions This article tells you how to add keywords and descriptions to zblogphp.

The official wiki of zblog gives the following answer:

 {php}         if($type=='index'){                 $keywords = $zbp->option['ZC_BLOG_SUBNAME'];                 $description = $zbp->option['ZC_BLOG_COPYRIGHT'];         }elseif($type=='category'){                 $keywords = $category->Name;                 $description = $category->Intro;         }elseif($type=='article'||$type=='page'){                 $aryTags = array();                 foreach($article->Tags as $key){                         $aryTags[] = $key->Name;                 }                 if(count($aryTags)>0) $keywords = implode(',',$aryTags);                 $description = preg_replace('/[\r\n\s]+/', '', trim(SubStrUTF8(TransferHTML($article->Content,'[nohtml]'),100)).'...');         }{/php}{if isset($keywords)&&strlen($keywords)>0}<meta name="keywords" content="{$keywords}" />{/if}{if isset($description)&&strlen($description)>0}<meta name="description" content="{$description}" />{/if}

This method calls zblog's own tags, such as calling website subtitles in the background. The degree of customization is not very high, and friends who do not know PHP can not understand and change it. Tianxing Studio introduces a method, which is similar to that of the zblogasp version. The steps are as follows:

1. Find the theme template folder you are using. Take the zblogphp default theme as an example, open "default" → "template", and there is a "header. php" in it. We copy all the code after opening it.

2. Create a new "header1. php" file, paste all the code just copied, and then add keywords and description code under the line "<title>{$name} - {$title}</title>":

 <meta name="description" content="Description"/> <meta name="keywords" content="keywords"/>

Modify your keywords and descriptions and save them.

3. Open the "index. php" file, modify the first line of code "{template: header}" to "{template: header 1}", save it, and upload the modified file with ftp software. The background refreshes, and the foreground can see the effect.

Note: The above three steps modify the keyword description on the homepage of the website. The keyword description on the list page and content page can be modified according to the idea of adapting the header file to the corresponding file.


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 five Comments from netizens:

  •  A little welfare

    A little welfare Six years ago (2018-07-25) reply

    Modified, but not effective, Tang Shijun's blog template

    •  Tianxing Studio

      Tianxing Studio Six years ago (2018-07-25) reply

      The Tang Shijun theme comes with this function, which is in the theme configuration in the upper right corner of the background

  •  A rainy night

    A rainy night 10 years ago (2014-11-26) reply

    None of my business...

  •  visitor

    visitor 10 years ago (2014-11-20) reply

    After the call, the keyword displays garbled code. How can I solve this problem,

    •  Tianxing Studio

      Tianxing Studio 10 years ago (November 21, 2014) reply

      Coding problem. Zblogphp does not recommend that you change to a free plug-in for use

welcome you Comment: Cancel Reply

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