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

62 posts
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 1 year
thememassive 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.

584 posts WordPress Gurus!
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+3 more
ThemeBeans says

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

62 posts
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 1 year
thememassive 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?

520 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 3 years
  • Sells items exclusively on Envato Market
  • Won a Most Wanted contest
+2 more
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
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
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.

1509 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE says

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

584 posts WordPress Gurus!
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+3 more
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!

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by