WPservice DEVELOPMENT STUDIO PRESENTS
LONG-TERM GROWTH
We always design our websites with your future success in mind, carefully planning and optimizing all content to ensure maximum visibility and long-term profitability

WordPress Own Theme? Easy With These 7 Tips

wordpress own theme

Image credit: instantshift.com

If you’re looking to up your game with your WordPress own theme, let’s take a look at 7 ace tips and tricks that will enhance you as a theme developer.

Take Advantage Of get_template_part

The get_template_part function is not just a normal old php include, and is used to incorporate template files into your theme.

get_template part is an original way to incorporate files because of its child theme awareness; as well as this, get_template_part breaks down your theme into bite-sized chunks and comes with a neat fallback model.

Enqueue Scripts and Styles

An ace WordPress coding theme tip is to enqueue your scripts and styles.

When working with Javascript and CSS files, it’s really tempting to hard-code them in header.php. But this is a bad thing to do. Instead, you should use wp_enqueue_script and wp_enqueue_style.

WordPress will do the rest.

The best thing about these functions is that they allow for automatic dependancy resolution.

Customiser > Theme Options

When working on your WordPress own theme in the past, you may have noticed that most WP themes come tied with a theme options page. In WP 3.4, though, WP introduced something called the Theme Customiser.

The Customiser is an extremely handy tool that you need to use. It has pre-built controls for things like drop down selects and text, as well as more complicated controls for the image uploader and the colour picker.

Use An Editor Style For Your WordPress Coding Theme

There are something like 1,600 WP themes available, but only 200 come with an editor style. This is very frustrating because what you see looks nothing like what eventually gets published.

You can actually add an editor style to your theme by calling add_editor_style when setting up your theme in functions.php. Then add an editor-style.css file to your template.

Ignore query_posts

There are three ways to query in WordPress, and you should avoid each one when working on your WordPress own theme.

Why? Because secondary queries in WP replace the main query with a different one, and invariably break things like titles and pagination. Not cool.

To apply a secondary query without changing the main query, use either get_posts or WP_query. They are much much safer.

Don’t Start From Scratch

Working on a new WP theme from an empty folder is a nightmare. To speed up custom WordPress theme development, you should use each of the following:

  • Child themes
  • Theme frameworks
  • Starter themes

Know Your Tools Inside Out

You cannot become an ace theme developer if you don’t take the time to learn your tools. After all, you are only as god as your tools. Some of the tools you will need to know inside out include:

  • Theme check
  • Theme unit test
  • Log deprecated notices
  • Debug bar
  • Debug bar extender
  • Debug bar console
  • Monster widget
  • WordPress beta tester
  • Core control

Need help with WordPress coding theme? Then get in touch right away!

Comments are closed.