home page Site building tutorial Zblog website establishment text

Call the specified article in the zblog template

When developing zblog topics, it is sometimes necessary to call the specified classified articles to the specified template area. How to call the specified classified articles in the zblog page can be achieved by the following methods. For the first method, just call the following code at the corresponding location of the template: {foreach GetList (number of articles, classification ID, null, null, null, array ('has_subcate'=>true))

Under development Zblog topic Sometimes it is necessary to call the specified classified article to the specified Template Area, then how to call the specified classified articles in the zblog page can be achieved through the following methods.

For the first method, just call the following code at the corresponding location of the template:

 {foreach GetList( Number of articles , classification ID, null, null, null, array ('has_subcate '=>true)) as $article} <a href="{$article.Url}" title="{$article.Title}" target="_blank">{$article.Title}</a> {/foreach}

The number of articles and classification ID are replaced with the number of articles and classification ID that you need to call

notes:

"Number of articles" in the code indicates the number of articles displayed in the called list, 5-10 recommended

"Classification ID" to zblogphp Background classification management View the classification ID number to be called

If the code does not call the articles under the parent category, please go to the background, click the website settings on the upper right, select page settings, and open the "List all articles under the category" switch.

Can also cooperate theme Configure the new article field, add switches, enable and call the current article to the specified page, with unlimited number and classification;

 {foreach GetList(null,null,null,null,null,null,array('has_subcate' => true)) as $article}  {if $article->Metas->umToHome=='1'}   <a href="{$article.Url}" title="{$article.Title}" target="_blank">{$article.Title}</a>  {/if} {/foreach}


The second call method:

 {foreach GetList (number of articles, category ID) as $article}   <a href="{$article.Url}" title="{$article.Title}">{$article.Title}</a> {/foreach}

Number of articles Fill in the number of articles you need to call and fill in the specified classification ID


Reward
poster

Statement: Some of the resources on this site are original works on the site, and some are publicly shared and collated based on the Internet. The copyright belongs to the original author.
If it infringes your rights, please contact our website, and we will deal with it as soon as possible. Thank you. Please indicate the source of the transfer

Link to this article: https://www.umtheme.com/zblog/108.html

Related recommendations

 The list of zblog custom categories is sorted by browsing volume, comments, update time, ID or author

The list of zblog custom categories is sorted by browsing volume, comments, update time, ID or author

ZBLOG provides rich interfaces to facilitate the personalized customization of webmasters, so it is easy to reorder articles. For example, it may be necessary to adjust the default sorting of the system during the development and production process (the latest one is first), so that the list of articles under a certain category on its website is based on the specified (browse volume
Zblog website establishment 2022.10.16 zero three thousand and sixty
Post comments

Thank you for your support