How to Add Wordpress category programmatically

  How to Add Wordpress category programmatically

 
function example_insert_category() {
 wp_insert_category(
  array(
    'cat_name'  => 'Example Category',
    'category_description'=> 'This is an example category ',
    'category_nicename' => 'example-category',
    'taxonomy'  => 'category'
  )
 );
}
 
add_action( 'after_setup_theme', 'example_insert_category' ); 
 
You can add category at runtime this is the example
Most popular dynamic way is this , make post programmatically
and post it to public view and share it 
 
thanks for watch..... 
 

 
Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

5 comments:


  1. Hello,

    we provide affordable and result-oriented SEO services, please give a chance to serve you.


    Thanks
    Admin: E07.net

    ReplyDelete
  2. FREE Express Shipping by DHL - We used DHL that delivers in 3-4 days in the US, Canada, Australia, Japan, and the countries located in Western Europe. The delivery time is around a week for Eastern Europe, South Korea, and other countries. Custom Iron On Patches

    ReplyDelete
  3. This is very interesting content! I have thoroughly enjoyed reading your points and have come to the conclusion that you are right about many of them. You are great. Howtodoninja

    ReplyDelete
  4. Thanks for the blog article. Really looking forward to read more. Cool.wordpress error establishing a database connection

    ReplyDelete
  5. FREE Express Shipping by DHL - We used DHL that delivers in 3-4 days in the US, Canada, Australia, Japan, and the countries located in Western Europe. The delivery time is around a week for Eastern Europe, South Korea, and other countries.ubanker

    ReplyDelete