Programmatically Create Category and sub Category

i create category have name Brand with this code. i have total 3 categories and each have 3 subcategories.

how to output 3 category and 3 subcategorys for all

function.php code

function insert_category() { if(!term_exists('brand')) {     wp_insert_term(         'Brand',         'category',         array(           'description' => 'sample category.',           'slug'        => 'brand'         )     );   }  } add_action( 'after_setup_theme', 'insert_category' ); 


Category: functions Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.243 (s). 12 q(s)