Provide zblog template_zblog them_wordpress template download and customization

Notes on the summary of zblogphp article list

Tianxing Studio 2015-09-12 21:38 Zblogphp Tutorial ten thousand and sixty-nine 8 Comments


Recently, many friends have been consulting Tianxing Studio about the summary of zblogphp article list. Most of them are about why the summary was generated manually when the article was published in the background, but it is not displayed in the foreground.

The reason is: the list of articles in the zblogphp template produced by Tianxing Studio The summary is all about getting content and limiting the number of words Of.

Why do you do this? Because it is necessary to ensure that the template will not make errors.

Many friends who are new to websites like to copy articles everywhere. The copied text contains a lot of code. Incomplete code copying will directly conflict with the whole page, and so on. Then it will be considered that there is a problem with the template.

Therefore, our direct approach is to remove the code and extract the text directly from the body content. No matter how many garbage codes there are, there will be no problem.

Of course, some friends still feel inconvenient when doing this, and they feel that they can't define the content of the summary by themselves. This article will tell you how to modify it to meet your own requirements.

First, the template of the zblogphp article list is“ post-multi.php ”And“ post-istop.php ”Where "post multi" is the normal article list and "post istop" is the top article list.

Open these two files, and the code displayed in the summary of the template produced by Tianxing Studio is generally as follows:

 {php}$description = preg_replace('/[\r\n\s]+/', '', trim(SubStrUTF8(TransferHTML($article->Content,'[nohtml]'),170)).'...'); {/php} {$description}

Replace the above code with "{$article. Intro}", which is the called system summary. You can customize the output of the article summary when you publish the article.

Supplementary reading: The method of zblogphp to clear the summary code and control the number of words


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

Related recommendations

yes eight Comments from netizens:

  •  Netizens of Tianxing Studio

    Netizens of Tianxing Studio Six years ago (2018-12-12) reply

    Hello, after the change, the style of the home page summary is different on the PC side and the mobile side, overflowing

  •  utc

    utc 8 years ago (2016-09-28) reply

    Excuse me, how does this code contain html code without formatting code? For example, my content only has a video code of 400 characters, which can't be used. If it is an automatic summary, only the previous part can be intercepted, which results in that the summary video on the home page cannot be displayed normally, and a part of the video code is also displayed. You can only specify the summary location manually. The default summary length setting cannot be found even after searching for half a day.

    •  Tianxing Studio

      Tianxing Studio 8 years ago (2016-09-28) reply

      I don't know what you mean. Anyway, you just need to understand this: there are only two ways to clear the summary, one is to get the content and filter out the code, leaving only text; The other method calls the summary directly without filtering at all. What the summary displays is under your own control (the disadvantage is that each article has to edit the summary). After understanding this, you can choose a suitable solution according to your own needs.

      •  utc

        utc 8 years ago (2016-09-29) reply

        If you want a code that does not filter, you can specify the length. For example, by default, you should not filter the code, but you cannot specify the length. I don't know where to change the default length.

        •  Tianxing Studio

          Tianxing Studio 8 years ago (2016-09-29) reply

          Specify length without filtering code? Then you can directly call the default summary and edit it to control the length. This is the simplest way.

      •  utc

        utc 8 years ago (2016-09-28) reply

        Can this code be modified to unfiltered code? If you delete nohtml, an error will occur, and no other changes will be made. You want to try offline editor publishing, but after filling in "hr class=" more "/" and sending it, the code will become "hr/" or "! -- more --" depending on the software, but the specified summary will be invalid.

welcome you Comment: Cancel Reply

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