Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I bought a theme from Themeforest and now I would like to convert it to a custom made theme. I was creating the theme with the Underscores theme: http://underscores.me/ but how do I keep the same custom post types in the next theme?

Is this less time consuming than recoding the purchased theme?

share|improve this question

closed as not constructive by Brian Fegter, Chris_O, Chip Bennett, Wyck, kaiser Sep 17 '12 at 21:20

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

up vote 0 down vote accepted

Move the custom post types to a plugin. They should never be part of a theme for exactly the reason you asked here. :)

In your theme add just the needed template files, but not the code for post type registration.

share|improve this answer
    
is there any good reference on how to do this, I have made a few theme's now alwasy with custom types. A lot of the times the same, I would find it interesting if I could move this into a plugin. –  woony Sep 17 '12 at 14:19
1  
You need just a plugin header and the registration function. Something like this: gist.github.com/889394 –  toscho Sep 17 '12 at 14:24
    
oh ok, so I can just put any code I would normally put in functions into a 'plugin-codefile' and it will work when plugin is activated just like it would if it were in functions.php . That's a great bit of information, I will try this out this evening. Thanks and sorry for the sort of 'off-topic' –  woony Sep 17 '12 at 14:33
    
@toscho this seems like a great idea thanks! would be a great way to make sure things are working correctly in the future –  Joe Bobby Sep 17 '12 at 18:51

My suggestion would be to simply create a child theme - it would definitely be less work, and you could extend anything that currently exists in the theme you purchased.

Before you do this, I would suggest installing the Theme Authentication Checker (TAC) and run it through the theme you purchased. If there are a lot of errors, then chances are in the future when you update WordPress, their code could indeed break. If that's the case, I'd suggest using their resources and re-code it - better to start off properly, than have to fix it in 6 months when the code isn't fresh.

That said, developing your own themes is always preferable, if you have the ability and knowledge of WordPress best practices.

As for retaining the custom post types, and other aspects of the them you purchased, it totally depends on the developer's style. Your best bet is to load the site into an IDE with site-wide search, and look for register_post_type and any other syntax that creates the content you want to bring to your custom-made _s theme.

Hope this helps! :)

Tutorial on Child Themes

share|improve this answer
    
Thanks for the suggestion! I didn't think about a child theme since I have never created one before, but if I do create a child theme would it be similar to starting from scratch or does the Parent theme have all the elements loaded? I think I'm leaning more towards creating my own theme just have to think about everything.. The Custom Post Types were actually created with some Post Type Creator within the theme so I'm not sure I can search for register_post_type but I will try that out soon and let you know how it turns out. Thanks! –  Joe Bobby Sep 17 '12 at 18:54
    
I'll attach a great tutorial above on how to create a child theme. Essentially it's uses the original theme first, then overwrites with your child theme. Example: if you have header.php in your main theme, but want to alter it - copy it into your child them, and make there alterations there. –  Eric Holmes Sep 17 '12 at 23:47

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