Return to Snippet

Revision: 23946
at February 17, 2010 05:10 by m-pokrovskii


Initial Code
<?php
   #exclude children category
   $get_childs = get_categories('child_of='.$cat);
   $q_cat = "cat=$cat";
   foreach ($get_childs as $cat_child) {
      $q_cat .= ",-$cat_child->cat_ID";
   }
   $query = new WP_Query($q_cat);
?>

Initial URL
pokrovskii.com

Initial Description

                                

Initial Title
Wordpress. Exclude children category

Initial Tags
wordpress

Initial Language
PHP