Thord Daniel Hedengren - Smashing WordPress_ Beyond the Blog-Wiley (2014)

(avery) #1

CHAPTER 2 • The WordPress Syntax 27


Figure 2-1: You’d better get used to browsing the WordPress Codex.


THE WORDPRESS CORE


Any good content management system (CMS) will keep its core files separate from other files
so that you don’t ruin the code that makes the system work, and WordPress is no exception.
For WordPress, the core refers to the internal files that make WordPress work. These are the
parts of WordPress that you should never touch, as any update to the platform will overwrite
your changes. Messing around with WordPress core files can also break theme and plugin
functionality, as well as open up your install for malicious use from outsiders. In short, don’t
touch the WordPress core. The only core file you should ever touch is wp-config.php (see
Chapter 1, “The Anatomy of a WordPress Install”), which contains the necessary details for
your install.


Outside of the core is the wp-content folder, where you’ll drop themes as well as plugins and
uploaded files. All these things work on top of WordPress, so there’s no risk of ruining the
actual system files (unless you’ve installed malicious code, but that’s a completely different
matter) when you develop a site. In fact, the whole idea is that the only time you’re editing or
even doing anything outside of the wp-content folder is when you’re installing the system —
and possibly when moving the install files to a different folder. Naturally, there is some cool
stuff that requires editing the .htaccess file, and you’ll come across plugins that want you to do
things outside of wp-content. That’s fine, of course, although you should be a bit cautious. In
short, whenever you’re told to edit a file outside of wp-content, beware. Creating new files is
one thing; editing existing files is a no-no, wp-config.php and .htaccess excluded.

Free download pdf