WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating some sliders type functionality for my wordpress theme and I thought that creating two seperate db tables like 'sliders' and 'slider_images' is a good idea.

My problem is that i don't know what is the best way to handle the creation of those tables. If it was a plugin, I would just do it on activation, but it is just some functionality as part of my theme and i haven't really found a hook that is executed once when the theme is activated.

If possible, i would like to not have to check the database for the existence of tables in every page refresh and create if not. Is there a way to do that ?

share|improve this question
up vote 4 down vote accepted

Don't use separate database tables in a Theme, especially for creating custom content types. Use WordPress-core Custom Post Types.

share|improve this answer
oh, I see thanx ! – SpyrosP Aug 25 '12 at 20:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.