33 posts
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LuminouseyeGFX says

Hello,

According the themeforest new requirement about shortcodes, Should I include all the shortcode styles and third party scripts like flexslider and etc also inside the plugin? Or they can be inside my theme?

1293 posts The Last Man Standing
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Sells items exclusively on Envato Market
+7 more
ImanGM says

Hi,

You should put them in a plugin and then enqueue styles and scripts in your plugin.

Cheers,
Iman

33 posts
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LuminouseyeGFX says

Thanks Iman for the reply.

1293 posts The Last Man Standing
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Sells items exclusively on Envato Market
+7 more
ImanGM says

You are welcome :)

33 posts
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LuminouseyeGFX says

Ok one thing more. I need to use the css and javascript code of a component for my theme and also shortcode plugin. How I can be sure that the css file and js for the same component has registered one time in page. Like if the theme already registered those scripts and style then plugin should not enqueue them or if the plugin did already then theme should stop register and enqueue them.

Any Idea?

89 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+3 more
hainug says

You just need to make sure the $handle is same, on plugin and theme, it’ll prevent to load double.

wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );

33 posts
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LuminouseyeGFX says

I also have the same question about custom post types which they also need to be inside a plugin.

Should I move my single-custom-post-type.php files also inside the plugin along with all of the styling?

626 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ChapterThemes says

I also have the same question about custom post types which they also need to be inside a plugin. Should I move my single-custom-post-type.php files also inside the plugin along with all of the styling?

Template files should be in the theme

291 posts mekshq.com
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Had an item featured in a magazine
  • Sells items exclusively on Envato Market
+5 more
meks says

Hi,

You should put them in a plugin and then enqueue styles and scripts in your plugin.

Cheers,
Iman

I would suggest to have scripts in plugin, but styles in both theme and plugin.

Different themes may have different styling for shortcodes. I would suggest only some overall styling in the plugin style, and then something more specific into theme style.

632 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+5 more
UBLThemes says

You do not have to give js and css.

The meaning for this new rule is so that [shorcode] etc does not show frontend.

As long as the code is there the user can style etc themselves, you do not have to supply your css or javascript to make it work on someone elses theme, its just so that the user does not have dead shortcodes, and they can at least style them after changing themes.

In most cases people who use only bootstrap etc should not need to style to much when changing themes.

But anyway to answer your original question.

No you do not have to give css and javascript within the plugins, you only have to make the shortcodes available to transfer, after that the user can do with them as they please.

by
by
by
by
by
by