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 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!!!