Provide zblog template_zblog them_wordpress template download and customization

Zblog function GetCategoryByID: Obtain classification object data through classification ID

Tianxing Studio 2022-07-24 20:38 Zblog function seven hundred and sixty-five 0 Comments


Introduced before“ GetCategoryByName ”Function to obtain the data of the classification object through the classification name. However, the classification name may be duplicate, so it is more recommended to use the "GetCategoryByID" function to obtain the object data of this classification through the classification ID. The classification id is unique and not prone to errors.

GetCategoryByID The function is constructed in“ zblogphp . php "file is about 3300 lines.

Function parameters:

$id: integer type, which is the classification id of the data to be obtained;

Function output:

Output an object object whose contents are all values of the specified classification.

For example, output the name of the classification whose classification ID is "1":

 $zbp->GetCategoryByID(1)->Name;

It is better to judge whether the classification ID exists before use:

 if($zbp->GetCategoryByID(1)->ID !=  0){ //There are classifications with ID 1 }

Then we can get other classified data. Other data values are as follows:

 Zblog function GetCategoryByID: Get the classification object data through the classification ID GetCategoryByID zblog function zblog function Page 1


Can't find a tutorial that can solve your problem?

You can try to search or ask questions directly online. We also provide charging technical support. If you need it, you can contact us online.

Online questions Online Service

welcome you Comment: Cancel Reply

 Please fill in the verification code
  • Latest articles
  • Hot article ranking
  • Most Comments
Label aggregation
  • Sign in
  • Registered account Forgot your password?
  • register
  • Already have an account? Direct login Forgot your password?
  • Social account login