1399 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



> 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.

185 posts I'm a Husky Designer
  • Won a Competition
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Interviewed on the Envato Notes blog
  • Sold between 100 000 and 250 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Referred between 200 and 499 users
designcrumbs says

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

HAVE WE BEEN SUMMONED?

158 posts
  • Power Elite Author
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Exclusive Author
  • Has been a member for 4-5 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
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.

3117 posts
  • Sold between 5 000 and 10 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
  • Exclusive Author
chrisakelley 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') ){}

1399 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


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





> 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?

1989 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Has been a member for 4-5 years
  • Author had a Free File of the Month
  • Won a Competition
  • Bought between 10 and 49 items
+4 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 ?
730 posts
  • Elite Author
  • Attended a Community Meetup
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Most Wanted Bounty Winner
+2 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.

730 posts
  • Elite Author
  • Attended a Community Meetup
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Most Wanted Bounty Winner
+2 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.

1399 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

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