Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8483201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:01:41+00:00 2026-06-10T20:01:41+00:00

As i tried with this code , this seems fine but only few subcategory

  • 0

As i tried with this code , this seems fine but only few subcategory are created and few not. I am not getting the problem.Please tell me if there’s something missing.

$catIdOfTransport='112';
wp_create_category('car',$catIdOfTransport) ;
$arr=array('maruti','nano','bmw');
$val=count($arr);
for($j=0;$j<$val;$j++){ wp_create_category( $arr[$j], 'car'); }    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:01:42+00:00Added an answer on June 10, 2026 at 8:01 pm

    wp_create_category($values, $parent);

        $valow=strtolower($values);
        $slugcre=str_replace(" ","-",$valow);
        $slugname=$slugcre."-transpost";
        $idObj = get_category_by_slug($slugname); 
    
        $id = $idObj->term_id;
        $parent1=$id;
        $val=count($arr[$i]);
    
        for($j=0;$j<$val;$j++)
                 {
                    wp_create_category( $arr[$i][$j], $parent1);
                 }  
    

    i think this code can help you .

    Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have tried this code to redirect a php page.but it s not working
i've tried using this code and this to make a random quote generator, but
I tried to use this code but it doesn't work. http://developer.apple.com/library/ios/#samplecode/PageControl/Introduction/Intro.html Ld /Users/waitonza/Library/Developer/Xcode/DerivedData/Dr_Ngoo-aanknxmuodcgjicaigxevljxokeq/Build/Products/Debug-iphonesimulator/Dr Ngoo.app/Dr
Update: This only seems to be a problem at some computers. The normal, intuitive
Code-wise this seems so simple, but I still get stuck on a #VALUE. I
This question was asked few other times, but I still did not manage to
I tried this code to open a file in Python: f = open("/Desktop/temp/myfile.txt","file1") It
how to make php can read log file in /var/log/.... I tried this code
I am trying to enable mod_deflate. I have Apache 2.0+ and tried this code
I tried with this code to post on the wall (Twitter) of a user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.