I am under the impression that Custom Post Types need to be in a plugin, is it true?

45 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 0-1 years
sunnywill says

Hello,

I’m using Portfolio Post Type plugin to create the functionality of Portfolio Post Type in my theme, and I’m including this plugin through TGM from the Wordpress repository. Now this plugin only takes care of creating custom post type (Portfolio), and I do the styling of the Portfolio items in my theme.

Now I’ve been under the impression that it was a requirement of Themeforest to have things like Custom Post Type in a separate plugin. I can’t remember where I read that, but I can’t find this anywhere now, not even in the Wordpress Theme Requirement section. I’m very confused about this and would really appreciate if someone can clarify if we are required to have plugins embedded in our theme, if not, then what about the plugins that rely on some configuration, are we supposed to make separate plugins for that?

Please let me know about this and thank you very much.

419 posts WordPress Gurus!
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 1-2 years
  • Referred between 200 and 499 users
  • United States
ThemeBeans says

Im pretty sure it is – but it’s a good idea/practice to include them as plugins anyhow.

45 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 0-1 years
sunnywill says

Im pretty sure it is – but it’s a good idea/practice to include them as plugins anyhow.

But what about the styling that would go with the plugin, that you have to include with the theme? I mean if I would be asking users to install the plugin through TGM and through Wordpress Repo, what should I do about the styling of the items? Create a plugin for that too, or it’s ok if I include it with my theme files?

427 posts
  • Europe
  • Exclusive Author
  • Most Wanted Bounty Winner
  • Sold between 10 000 and 50 000 dollars
  • Referred between 1 and 9 users
  • Microlancer Beta Tester
  • Has been a member for 2-3 years
rayoflightt says

Content goes in plugin, styling in theme. That means shortcodes and custom post types should be in plugin but styling for them inside theme.

284 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Referred between 10 and 49 users
  • Sold between 100 and 1 000 dollars
  • United Kingdom
Shellbot says

The idea is for your users to be able to access content they create with this CPT, regardless of which themes they use over the years. Your theme can and should have extra styling to make the CPT look perfect alongside everything else, but when your theme is disabled the content itself remains.

Sidenote: I’ve also struggled to find these requirements written down anywhere on TF, but am glad they’re being adopted anyway.

1400 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • Croatia
OriginalEXE says

Just a note: This is not currently a requirement for approval, but it’s a good practice so do it anyway.

419 posts WordPress Gurus!
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 1-2 years
  • Referred between 200 and 499 users
  • United States
ThemeBeans says


Im pretty sure it is – but it’s a good idea/practice to include them as plugins anyhow.
But what about the styling that would go with the plugin, that you have to include with the theme? I mean if I would be asking users to install the plugin through TGM and through Wordpress Repo, what should I do about the styling of the items? Create a plugin for that too, or it’s ok if I include it with my theme files?

Like what others have mentioned – your theme style.css should contain the appropriate styles, and the package should have the single/archive/etc custom templates – if necessary. The CPT plugin is basically just to create the post type itself, and to maintain that data outside of your theme files.

Hope we’ve helped!

by
by
by
by
by
by