37 posts
  • Author Level 2
  • 1 Year of Membership
  • Collector Level 1
  • Exclusive Author
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?

1891 posts The Last Man Standing
  • Weekly Top Seller
  • Author Level 8
  • Beta Tester
  • Moderator
+10 more
ImanGM
Moderator
says

Hi,

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

Cheers,
Iman

37 posts
  • Author Level 2
  • 1 Year of Membership
  • Collector Level 1
  • Exclusive Author
LuminouseyeGFX
says

Thanks Iman for the reply.

1891 posts The Last Man Standing
  • Weekly Top Seller
  • Author Level 8
  • Beta Tester
  • Moderator
+10 more
ImanGM
Moderator
says

You are welcome :)

37 posts
  • Author Level 2
  • 1 Year of Membership
  • Collector Level 1
  • Exclusive Author
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?

124 posts
  • 4 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Collector Level 1
+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 );

37 posts
  • Author Level 2
  • 1 Year of Membership
  • Collector Level 1
  • Exclusive Author
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?

683 posts
  • 4 Years of Membership
  • Author Level 5
  • Collector Level 2
  • Exclusive Author
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

310 posts mekshq.com
  • Elite Author
  • Trendsetter
  • Weekly Top Seller
  • Featured Author
+8 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.

689 posts
  • Affiliate Level 3
  • Author Level 6
  • Beta Tester
  • Collector Level 4
+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