By default, the zblog home page list displays the articles of the whole site according to the time when they are published. If you do not want to display a classified article in the home page article circular list, you need to modify it through code or plug-ins. The following is a code tutorial that implements the zblog home page article list to exclude articles of the specified classification.
1. Add the following function code to the theme include.php file:
function qiteen_ exclude_ category(&$type,&$page,&$category,&$author,&$datetime,&$tag,&$w,&$pagebar){ global $zbp; if($type == 'index'){ $w[]=array('<>','log_CateID',1); //The following is to rebuild the paging, filter the classification, and the quantity will change $pagebar = new Pagebar($zbp->option['ZC_INDEX_REGEX']); $pagebar->PageCount = $zbp->displaycount; $pagebar->PageNow = $page; $pagebar->PageBarCount = $zbp->pagebarcount; } }
code array('<>','log_CateID',1)
The number 1 in is the classification ID to exclude
2. In the ActivePlugin_ xxx()
Add the following code to the function:
Add_ Filter_ Plugin('Filter_Plugin_ViewList_Core','exclude_category');
After saving, the cache can be updated on the background home page to take effect.
Method analysis:
Specify the classification through function filtering, rebuild the paging, and hook Filter_ Plugin_ ViewList_ Core
Interface.
Interface location: zb_ system/function/c_ system_ Event.php. If you are interested, you can study it yourself.
Code transferred from blog