33 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 0-1 years
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?

1051 posts The Last Man Standing
  • Elite Author
  • Author had a Free File of the Month
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Exclusive Author
  • Bought between 10 and 49 items
  • Sold between 50 000 and 100 000 dollars
  • Beta Tester
ImanGM says

Hi,

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

Cheers,
Iman

33 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 0-1 years
LuminouseyeGFX says

Thanks Iman for the reply.

1051 posts The Last Man Standing
  • Elite Author
  • Author had a Free File of the Month
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Exclusive Author
  • Bought between 10 and 49 items
  • Sold between 50 000 and 100 000 dollars
  • Beta Tester
ImanGM says

You are welcome :)

33 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 0-1 years
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?

83 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Indonesia
  • Most Wanted Bounty Winner
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 0-1 years
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?

610 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
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

269 posts mekshq.com
  • Elite Author
  • Has been a member for 4-5 years
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Europe
  • Bought between 1 and 9 items
  • Referred between 50 and 99 users
  • Envato Studio (Microlancer) Beta Tester
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.

631 posts
  • United Kingdom
  • Sold between 10 000 and 50 000 dollars
  • Most Wanted Bounty Winner
  • Interviewed on the Envato Notes blog
  • Referred between 50 and 99 users
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
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