Adding an image to the post

Now, if we go to the form shown here to add a post, and you look on the right-hand side, you don't see a Featured Image box, which you may have seen in other WordPress themes or on other WordPress websites. The reason for that is we didn't include that functionality:

  1. Let's go into our themes folder, and we'll create a file and save it as functions.php. Now, this is where we can put a custom function; this is where we can hook into certain parts of the code, register widgets, and do all that—basically, anything dynamic.
  2. Here, we'll create a setup function. To do this, we will add the following code block:
 <?php ...

Get Learn to Create WordPress Themes by Building 5 Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.