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

(avery) #1

30 PART I • Getting Started with WordPress


gotten started on widgets yet, which are areas where you can drop elements from within the
admin interface. There is also the option to keep the loop, which is the code that outputs the
main content in your theme, separate from your other template files using loop.php and such.
The loop is covered in-depth in Chapter 3, “The Loop.”

Figure 2-4 shows the Themes page in the WordPress admin interface. From this page, you can
change your theme with a single click or get new themes from the WordPress.org theme
repository.

Figure 2-4: The WordPress admin interface makes theme management easy.

The best way to learn about themes is to use them. Install a theme on a test blog, play around,
and then take a look at the files it consists of. Don’t bother with images and forget about the
style sheet as well (it is just a design), but do take a look at index.php and both header.php and
footer.php to understand the way themes are built. It’s not very complicated: First, you load
index.php (or whatever main template file is used; this could also be single.php, category.php,
or something else), and then that file will load files such as header.php, footer.php, and
possibly sidebar.php, for example.

You’ll play with themes later, but for now all you need to know is that it’s in the theme’s
template files that the magic happens. There you’ll find the code that outputs the content
you’ve posted using WordPress, and although various themes may look and behave differently,
they are just displaying the same thing in different ways, thanks to the template files.
Free download pdf