Created
August 1, 2013 05:49
-
-
Save siddhartanaranjo/6128695 to your computer and use it in GitHub Desktop.
list my categories function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function list_my_categories(){ | |
$categories = get_categories('parent=0'); | |
$html = ''; | |
foreach ($categories as $q_cat) { | |
$cat = get_category($q_cat); | |
$html .= '<div class="span12 service_container"><div class="row">'; | |
// category parent | |
$html .= '<div id="piscinaProduct" class="span12 product_block product_name_title_active">'; | |
$html .= '<h2 class="product_name_title main_title">'.$cat->cat_name.'</h2>'; | |
$html .= '</div>';//end category parent | |
$html .= '<div class="span12 subCategoria"><div class="row">'; | |
$categories = get_categories('parent='.$cat->cat_ID); | |
foreach ($categories as $q_cat) { | |
$cat = get_category($q_cat); | |
$html .= '<div class="span4 blueBackground service_name">'; | |
$html .= '<a href="'.$cat->cat_term_id.'">'; | |
$html .= '<h2 class="product_name_title">'.$cat->cat_name.'</h2>'; | |
$html .= '</a>'; | |
$html .= '</div>'; | |
} | |
$html .= '</div></div>';//subcategorias | |
$html .= '</div></div>'; | |
} | |
$html .= ''; | |
return $html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment