1554 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



> I’d suggest taking a look at the work Mike McAlister does: http://themeforest.net/user/mikemcalister – He uses a single “Okay Themes Toolkit” plugin that houses all of his functionality, and each of his themes is very unique.

What happens if:

1.) His users only install theme and not the plugin 2.) His users go to another theme leaving plugin installed

I’m interested in how he handles that.

P.S. Maybe that could be a topic in the new episode of Please Advise
If the plugin that provides a certain feature isn’t active, then the theme should act as a standard theme. In the context of this whole discussion, the theme would act as a “simple skin”, but then when the plugin is activated, the advanced features become available.
But what about if for example, I build a framework into a plugin, and in the framework I have the functionality to easily register custom post types.

Now, since plugin is used in multiple themes, it does not know what cpt’s I will register, so I do this by hooking into it with my theme.

But, if user changes theme, there is no more hook and plugin no longer displays ctp in wp admin.

How do I handle that?

Same goes for shortcodes, I could build in all of my shortcodes into plugin framework, and call it via theme, but if I deactivate the theme, how would I handle that?

One thing that comes to my mind is to detect in a plugin if my theme is used and if not, just simply register all shortcodes (not for use but for parsing), but I am not sure how I would go about it with cpt’s.

221 posts King of the Freakin' Interwebs
  • Had an item that was trending
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has sold $250,000+ on Envato Market
+8 more
designcrumbs
says

P.S. Maybe that could be a topic in the new episode of Please Advise

HAVE WE BEEN SUMMONED?

176 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Had an item that was trending
+6 more
stmcan
says


You didn’t understand my question. Let’s say I’m just starting and I’m creating a plugin for the first theme. But the second theme is a real estate theme. And real estate themes have their own features and shortcodes, different than the first theme(that doesn’t need the real estate features). And maybe the real estate theme uses the pricing tables in a different way than the first theme. What’s to be done then? I’m talking about shortcodes here. Since we’re not plugin developers, we can’t create an extremely complex plugin to cover, for example, all the portfolio possibilities, we only create what we need for a specific theme. When a new portfolio theme comes in the discussion, we re-review what we have in the current plugin and discover we need some new features / functions / etc. So in the end we basically need a new plugin for each theme, which is extremely bad and very hard to maintain.

Ultimately I’d suggest that you have one plugin for each major “kind” of functionality. Create a plugin that handles all of the features needed by your real estate themes; create a plugin that handles all of the portfolio features. When you do that, you can use the plugin in one theme or in 15 themes. You can also mix and match them.

If you’re able to create those features in a theme, it’s really not hard to move them into a plugin. The code is identical, only the location is different.

It is not possible for all themes. In my case i have to create another product showcase plugin for my each theme because there are some options just for the theme and it is related with the design.

3439 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Achieved the monthly Community Superstar Award
  • Located in United States
+2 more
organicbee
says




> I’d suggest taking a look at the work Mike McAlister does: http://themeforest.net/user/mikemcalister – He uses a single “Okay Themes Toolkit” plugin that houses all of his functionality, and each of his themes is very unique.

What happens if:

1.) His users only install theme and not the plugin 2.) His users go to another theme leaving plugin installed

I’m interested in how he handles that.

P.S. Maybe that could be a topic in the new episode of Please Advise
If the plugin that provides a certain feature isn’t active, then the theme should act as a standard theme. In the context of this whole discussion, the theme would act as a “simple skin”, but then when the plugin is activated, the advanced features become available.
But what about if for example, I build a framework into a plugin, and in the framework I have the functionality to easily register custom post types.

Now, since plugin is used in multiple themes, it does not know what cpt’s I will register, so I do this by hooking into it with my theme.

But, if user changes theme, there is no more hook and plugin no longer displays ctp in wp admin.

How do I handle that?

Same goes for shortcodes, I could build in all of my shortcodes into plugin framework, and call it via theme, but if I deactivate the theme, how would I handle that?

One thing that comes to my mind is to detect in a plugin if my theme is used and if not, just simply register all shortcodes (not for use but for parsing), but I am not sure how I would go about it with cpt’s.

see theme_supports, and require_if_theme_supports(needs to be used on init) so…

 

add_action('init', 'prefix_require_cpt);

function prefix_require_cpt(){

require_if_theme_supports('prefix-someCPT', PATHTOFILE);

}

then in your theme you would add.

add_theme_support('prefix-someCPT');

or in the plugin you could use if( theme_supports('prefix-someCPT') ){}

1554 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


P.S. Maybe that could be a topic in the new episode of Please Advise
HAVE WE BEEN SUMMONED?
1554 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





> I’d suggest taking a look at the work Mike McAlister does: http://themeforest.net/user/mikemcalister – He uses a single “Okay Themes Toolkit” plugin that houses all of his functionality, and each of his themes is very unique.

What happens if:

1.) His users only install theme and not the plugin 2.) His users go to another theme leaving plugin installed

I’m interested in how he handles that.

P.S. Maybe that could be a topic in the new episode of Please Advise
If the plugin that provides a certain feature isn’t active, then the theme should act as a standard theme. In the context of this whole discussion, the theme would act as a “simple skin”, but then when the plugin is activated, the advanced features become available.
But what about if for example, I build a framework into a plugin, and in the framework I have the functionality to easily register custom post types.

Now, since plugin is used in multiple themes, it does not know what cpt’s I will register, so I do this by hooking into it with my theme.

But, if user changes theme, there is no more hook and plugin no longer displays ctp in wp admin.

How do I handle that?

Same goes for shortcodes, I could build in all of my shortcodes into plugin framework, and call it via theme, but if I deactivate the theme, how would I handle that?

One thing that comes to my mind is to detect in a plugin if my theme is used and if not, just simply register all shortcodes (not for use but for parsing), but I am not sure how I would go about it with cpt’s.

see theme_supports, and require_if_theme_supports(needs to be used on init) so…

 

add_action('init', 'prefix_require_cpt);

function prefix_require_cpt(){

require_if_theme_supports('prefix-someCPT', PATHTOFILE);

}

then in your theme you would add.

add_theme_support('prefix-someCPT');
or in the plugin you could use if( theme_supports('prefix-someCPT') ){}

You did not get me.

What I am asking is, if I deactivate the theme (and use TwentyTwelve for example), the whole idea of this is to leave content accessible to users (it always stays in the database but the point is for it to be visible in wp-admin), and since I register custom post types via theme (as not all of themes use the same cpt’s), how do I handle theme deactivation?

2054 posts
  • Has referred 50+ members
  • Has sold $750,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+10 more
bitfade
says

I’d suggest taking a look at the work Mike McAlister does: http://themeforest.net/user/mikemcalister – He uses a single “Okay Themes Toolkit” plugin that houses all of his functionality, and each of his themes is very unique.
can his plugin be used with other themes as well ? does he support it in this case ?
737 posts
  • Has referred 1000+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Became a Top 20 Author of the Month
+8 more
mordauk
says

If a feature (such as a CPT) needs to exist with and without the theme, then you just register it globally, regardless of what theme is active.

737 posts
  • Has referred 1000+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Became a Top 20 Author of the Month
+8 more
mordauk
says


I’d suggest taking a look at the work Mike McAlister does: http://themeforest.net/user/mikemcalister – He uses a single “Okay Themes Toolkit” plugin that houses all of his functionality, and each of his themes is very unique.
can his plugin be used with other themes as well ? does he support it in this case ?

You’d have to ask Mike.

1554 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

If a feature (such as a CPT) needs to exist with and without the theme, then you just register it globally, regardless of what theme is active.
Hmmm yeah, have to think about the best way.
by
by
by
by
by
by