Creating WordPress themes directions

A chaque oiseaux son nid est beau.

When creating WordPress themes the following tips should be used:

  • Use wp_head, wp_titlewp_footer
  • Use get_template_part() or locate_template() when using templates
  • Include child theme support for the theme
  • Include wp_nav_menu() at least once in your theme
  • Do not modify wptexturize() filter
  • Do not modify wpautop() //just keep double line-breaks and do not transform them to paragraphs
  • Do not use deprecated functions or tags
  • Do not use Timthumb
  • Use wp_enqueue_style() to enqueue all stylesheets
  • Use wp_enqueue_script() to add any JavaScript code
  • Use JavaScript version that goes with WordPress
  • Provide local copy of a resource (CDN version) as a fallback
  • If possible load assets via SSL
  • Use external files to place JavaScript code if possible
  • Include JavaScript files in the footer if possible (exceptions Modernizr, jQuery UI, etc)
  • Eliminate WP theme errors or notices.
  • JavaScript should be written with “use strict” mode on.
  • </ul> For improved security perspective use inbuilt validate functions and sanitize function Input: wp_filter_nohtml_kses(), wp_filter_kses(), wp_kses(), Output: esc_attr(), esc_html(), esc_js(), esc_textarea(), esc_url() Thanks

tags: & category: -