/, WordPress General Info, WordPress Plugins/Why You Shouldn’t Code URLs in Themes or Plugins

Why You Shouldn’t Code URLs in Themes or Plugins

Avoiding the Use of hard-coded URLs is a habit that eventually leads to good coding.

Be it a theme or a plugin, there are a number of instances that require linking to other pages of your site or to spreadsheets or scripts or mentioning your own website’s URL in the code.

This invites a bulk of workload because if the site’s domain name needs to be changed or the theme needs to be used for other sites or you wish to lend your themes to other coders, the whole hard-coded URLs need to be updated.

If this update is inaccurate it leads to improper linking among spreadsheets and URLs and produce the very annoying 404 errors.

It is all the more risky when it comes to plugin coding.

It poses a problem in case you wish to change the plugin’s directory or try to run it on older version WordPress sites, the links will break.

So to save yourself from this tedious and eye-breaking task, it is good to use functions supported by plugin and themes.

It is also a good habit to make use of template tags that enable seamless linking solutions.

read the article here:http://code.tutsplus.com/tutorials/why-you-shouldnt-code-urls-in-themes-or-plugins-and-the-wordpress-functions-to-use-instead–cms-23262

By |2018-01-29T13:44:02+00:00January 26th, 2018|UsingWP, WordPress General Info, WordPress Plugins|0 Comments

About the Author:

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.