It is not clear how you want to use the new table.
The Pods CMS Framework plugin will let you define a custom table (POD) and gives you an API to use it.
Thanks,
I need new table because, if we store custom post type data in wp_posts it will increase the table size. Thanks for your reply.
Anyone know any other method, without using Pods CMS.
Thanks
Please do some research on Custom Fields.
They are not stored in wp_posts. They are stored in a separate table created just for this type data, so the size of wp_posts will not increase if you use them.
Also, using Custom Fields will avoid adding code to create/update/delete an extra table and its contents.
Sorry, Why you say about Custom Fields. I’m saying Custom Post Type not Custom Field.
Custom Post Type store in wp_posts. I need to store Custom Post Type in my own custom table with same structure as wp_posts.
Because, If we add so many data in wp_posts it will increase the table size. That’s why I need to store Custom Post Type data in different table.
Thanks for your reply
Sorry, I misunderstood.
There seems to be a lot of information on adding WP database tables in plugins. For example, this article:
http://www.wpmods.com/create-database-tables-wordpress-plugin/
And this from the Codex:
http://codex.wordpress.org/Creating_Tables_with_Plugins
It seems that a plugin would be a good idea to keep the code separate from any theme, so that you could change themes if it became necessary.
Yeah I saw that, we can create table. I need to use all WP Functions related to posts with this custom table. Functions like wp_insert_post, have_posts(), etc…
You have any suggestion for this?
This article from the Codex explains how to use the $wpdb class for any table:
http://codex.wordpress.org/Function_Reference/wpdb_Class