Custom Post Types and Shortcodes in new WordPress Theme


#1

Hello!
Currently we are developing a WordPress theme we hope we can get to sell it on ThemeForest, doing the Theme Check i see this issues:

WARNING: The theme uses the add_shortcode() function. Custom post-content shortcodes are plugin-territory functionality.
WARNING: The theme uses the register_taxonomy() function, which is plugin-territory functionality.
WARNING: The theme uses the register_post_type() function, which is plugin-territory functionality.

This means I can’t register a Post_Type in the theme itself right?
What would be then the best option to include my “Portfolio” post_type and all the custom shortcodes?
I was thinking to create a custom plugin and include it with TGM, is this the best option?

Thanks!


#2

Yes. You can’t register a Post Type in the theme itself.
You must create plugins for your custom post type and your shortcode and use TGM to activate them.
TGM seems to be a great solution and is also well known by users.


#3

You can create just one plugin to include your CPTs, shortcodes and stuff like that. No need for separate plugins for each of those features, but it’s up to you.


#4

Thanks both for the comments!
I’m gonna create a plugin and add it to the theme with TGM

I’ve also noticed than Theme Check show some errors in Redux Option Panel files, I googled it and found this entry from Redux

Do you know if this would be a problem to get the theme accepted in ThemeForest?

Thanks!


#5

It will not be a poblem to be accepted. Reviewers know about these warnings and errors. You can add in comment for reviewer that comes from Redux Framework and past the link you provide.
A lot of Wordpress theme accepted on ThemeForest use Redux Framework.