The Tree of Widsdom

智慧の樹

Tutorial: How to add a featured image


To add a featured image, first make sure that the blog image attributes are visible (if not, just run the .

  1. Paste or type the name of the image file in $blogImage.
  2. Type your title in $blogImageTitle. This sets the title, alt, and figcaption. You can use HTML formatting here, but you will need to enter it as markup inside the key attribute—e.g., “Hello <b>there</b>!” will export properly as “Hello there!” As always, BoxPress will strip out the HTML for the alt (accessibility) and title (tooltip) expressions. That is to say <b>, <i>, <u>, <code>, and <kbd> will all be removed
  3. Add some optional classes to $blogImageClass. By default, featured images are centered, responsive, and in a well. If this suits your taste, leave $blogImageClass empty. Built in BoxPress convenience classes for image position and sizing are img-left, img-center, img-right; and img-large, img-medium, img-small, and img-xs. Adding any override will remove img-well effect. (Thus, to simply remove the well, use a redundant img-center.)

For example, the image at the top of the Tutorial: How to add a featured image page has its $blogImageClass set to img-small img-center.

Otherwise it would be 512px and centered.
Otherwise it would be 512px and centered.