title: Programmatically create new category in magento
body: <p>I just want to create new category programmatically in magento. I have a code and tried this but can't success. </p>
  
  <p>code is here:</p>
  
  <pre><code>&lt;?php
  $parentId = '2';
  
  $category = new Mage_Catalog_Model_Category();
  $category-&gt;setName('check');
  $category-&gt;setUrlKey('new-category');
  $category-&gt;setIsActive(1);
  $category-&gt;setDisplayMode('PRODUCTS');
  $category-&gt;setIsAnchor(0);
  
  $parentCategory = Mage::getModel('catalog/category')-&gt;load($parentId);
  $category-&gt;setPath($parentCategory-&gt;getPath());              
  
  $category-&gt;save();
  unset($category);
  
  ?&gt;
  </code></pre>
  
  <p>actually the problem with this code whenever I tried it than it create new category but can't set is_active yes in admin.</p>