home page Site building tutorial Zblog website establishment text

The zblog homepage does not display/filter articles of the specified category

Implementation method: specify the classification through function filtering, and hook the Filter_Plugin_ViewList_Core interface after rebuilding the paging. Interface location: zb_system/function/c_system_event.php. If you are interested, you can study it yourself. Tutorial code: 1. In the?> Add the following function code above: function exclude_category (&am

Implementation method:

Specify the classification through function filtering, rebuild the paging, and hook Filter_Plugin_ViewList_Core Interface.

Interface location: zb_syst em /function/c_system_event.php If you are interested, you can study it yourself.

Tutorial code:

1. On theme In the last line of the include.php file Add the following function code above:

 Function topic ID_filter_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-> display count; $pagebar->PageNow = $page; $pagebar->PageBarCount = $zbp->pagebarcount; }	}

In the fourth line of the above code one Is the classification ID to be filtered. Please view the classification ID in background classification management.


2. In the function executed when the topic is activated (usually ActivePlugin_ Topic ID () {} )Add the following code:

 Add_Filter_Plugin ('Filter_Plugin_ViewList_Core ',' Topic ID_filter_category ');

It will take effect after saving.

I hope it can be helpful to users who need it.

Reward
poster

This article is written by Beautiful theme Original or collected and released

Please indicate the address of this article for reprinting: https://www.umtheme.com/zblog/111.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 two hundred and eighty-five
Post comments

Thank you for your support