ZBLOG summary description of the list of articles

Many sites new to write articles like friends everywhere to copy, copied the text which contains a lot of code, the code directly copied incomplete dislocation of the entire page will lead to conflict and so on. Then the template would be considered problematic due.

So our approach is to directly remove the code directly extract the contents inside the body of the text, as if there is no amount of garbage code is also not a problem.

Of course, this will still feel some friends inconvenient, can not own definition content summary of that pit father. Then this article gave you talk about how to modify for their own requirements.

First, the template ZBLOG list of articles is " POST-multi.php " and " POST-istop.php ", which "post-multi" is the normal list of articles, "post-istop" is the top of the list of articles.

Open these two files, code templates which make it ZBLOG summary display tube is usually this:

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

The above code will replace "{$ article.Intro}" is the summary of system calls, you can output your own custom page at the time of publication of the article.

Guess you like

Origin www.cnblogs.com/app574/p/11755750.html