1482 posts
  • Envato Team
  • Author Level 6
  • Meetup Participant
  • Affiliate Level 5
+14 more
kailoon
Envato team
says

1) You can check your theme files using a theme check plugin – http://wordpress.org/extend/plugins/theme-check/

2) Make sure you are using the right way to enqueue external scripts.

3) Make sure you include the basic wp hook within your theme.

4) Do not use php short tags.

5) Before any release you should turn on WP_DEBUG in wp-config.php to fix PHP errors and to see deprecated function calls .

6) Load external scripts ONLY when needed for a page template.

If you have any other tips would like to share with us, feel free to drop me an email and I will add it here. There are so many can be included here but above are those I think is important.

47 posts
  • 6 Years of Membership
  • Affiliate Level 2
  • Author Level 2
  • Collector Level 2
+2 more
nahid29
says

Wow this is cool.. Gonna try it now!

4483 posts ThemeForest Senior Reviewer
  • Affiliate Level 1
  • Author Level 6
  • Collector Level 3
  • Envato Team
+14 more
Ivor
Envato team
says

Another tip: Before any release you should turn on WP_DEBUG in wp-config.php to fix PHP errors and to see deprecated function calls .

1482 posts
  • Envato Team
  • Author Level 6
  • Meetup Participant
  • Affiliate Level 5
+14 more
kailoon
Envato team
says

Ah, no, you don’t have to turn on wp_debug, that’s for php checking. So, its optional.

Normally, that will only return bunches of php ‘notice’ which is not important.

EDIT : Now, you will need to turn on the wp_debug to test run your theme. Make sure there is no warnings, notices or errors appear.

1037 posts
  • Affiliate Level 6
  • Author Level 11
  • Collector Level 4
  • Top Monthly Author
+9 more
ThemeBlvd
says

Ah, no, you don’t have to turn on wp_debug, that’s for php checking. So, its optional. Normally, that will only return bunches of php ‘notice’ which is not important.

If you’re ever bored, it’s a fun game to play… Turn on wp_debug on one of your old WP themes, and see if you can bob all the notices on the head.

3535 posts
  • Power Elite Author
  • Author Level 12
  • Trendsetter
  • United States
+13 more
sevenspark
Moderator
says

For compatibility purposes I think a tip on using jQuery, either with a noConflict() declaration or else only using the $ variable within a closure would be very helpful. i.e. jQuery should either be done like this:

$j = jQuery.noConflict();
$j('#mydiv').awesomeTrick();

or

(function($) { 
    //code goes here
})(jQuery);

or

jQuery(document).ready(function($){
    //code goes here
});

More info: http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers

I’ve been supporting my WordPress plugin and it’s amazing how many themes don’t use wp_enqueue_script, load their own jQuery libraries and don’t use noConflict, etc. These themes don’t play nicely with others :(

Standards are good! :) Thanks for starting this thread, Kailoon!

2468 posts
  • 7 Years of Membership
  • Exclusive Author
  • Author Level 2
  • Collector Level 2
+3 more
digitalimpact
says

Being more of a buyer than a WP theme author, I would also add something from this point of view.

When naming your classes/ids, try to give them a unique name.

Example: if you’re using a jQuery tabs plugin, don’t just name your <ul class="tabs" />

I’ve had this recently and it interfered with a plugin that was using the same naming (=> plugin broken, theme broken)

I guess this would apply to more situations….

Also, please always properly name and document your functions – some of us like to dig in the code and it’ll help us understand it faster.

Thanks Kailoon for the topic :)

1383 posts
  • 6 Years of Membership
  • Affiliate Level 2
  • Collector Level 2
  • Exclusive Author
+1 more
wpCanyonThemes
says

Ah, no, you don’t have to turn on wp_debug, that’s for php checking. So, its optional. Normally, that will only return bunches of php ‘notice’ which is not important.

Actually deprecated functions are also shown when WP_DEBUG is on.

And my suggestions is not to turn it on when you’re done, but when you start developing, so you don’t have to clean up a mess at the end.

And + you improve your PHP skills.

7 posts
  • 6 Years of Membership
  • Exclusive Author
  • Super Copyright Ninja
DenB
says

Thanks Kailoon for the tips…

3535 posts
  • Power Elite Author
  • Author Level 12
  • Trendsetter
  • United States
+13 more
sevenspark
Moderator
says

That’s another good point from @digitalimpact – namespacing in general – both CSS classes and functions. You don’t want collisions with plugins, etc.

Namespacing in shortcodes is another question. I think usually it is a good idea but it does render those tags useless if a user switches themes. Still I think the first objective is to write the best code for users that are currently using your themes. For example, if a plugin uses the [tabs] shortcode and so does my theme, one of those will be overwritten. Safer to use [namespace-tabs] in my opinion.

by
by
by
by
by
by