Zblog calls a tutorial of the latest classified article

Li Yang's Blog 2020-05-29 1.74 W Reading 0 Comments

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

This code has existed for a long time, and can be used occasionally, but it must Baidu , because the brain is bad, I can't remember... So write down the code and add some memory. After all, good memory is better than bad writing, not to mention bad memory. Directly call the latest articles under a category (articles published in descending order) Include subcategory articles , OK, let's not say more, just code:

 {foreach GetList (call the number of articles, set the classification of articles, null,null,null,null,array('has_subcate' => true)) as $related}     <li><a href="{$related.Url}" title="{$related.Title}" target="_blank">{$related.Title}</a></li> {/foreach}

OK, The code includes Articles under subcategory , if Do not display articles of subcategories , go to the backstage, Site settings, page settings , open as shown in the figure“ List articles of all subcategories under the category ”Function.

 The first tutorial of zblog calling the latest article of a category

The code just calls the articles under a certain category, and it can also Call the latest article list of multiple categories For example, add an independent variable Function:

 {php} $cmsfl=explore (',', $zbp ->Config ('subject ID ') ->argument function); {/php} {foreach GetList (number of calling articles, $cmsfl, null,null,null,null,array('has_subcate'=>true))  as $key=>$related}     <li><a href="{$related.Url}" title="{$related.Title}" target="_blank">{$related.Title}</a></li> {/foreach}

That's it. When setting, use multiple classifications Comma in English (,) separation, for example: 1,2,3 , call all articles under category ID 1,2,3, including subcategories, do not know what category ID is, please go out and turn right or use the shortcut: Alt+F4!!!

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

Comment

Quick reply: expression:
 Addoil Applause Badlaugh Bomb Coffee Fabulous Facepalm Feces Frown Heyha Insidious KeepFighting NoProb PigHead Shocked Sinistersmile Slap Social Sweat Tolaugh Watermelon Witty Wow Yeah Yellowdog
Comment List (No comment yet, seventeen thousand three hundred and sixty-one People around)

No comment yet, let me say something

 cancel
 WeChat QR code
 WeChat QR code
 Alipay QR code