IVERSENDESIGN

Professional Website Design in Santa Cruz - Web, Graphic & Custom Software

  • Services
  • Our Team
  • Portfolio
  • Testimonials
  • Contact Us

Using a Featured Image as a Header Image

During the building of Valley Fresh Produce we wanted each inner page to have a header image relevant to the page. For this project, we were using WordPress and the Genesis framework. We didn’t want to manually hook in each image to each page through html or css. We wanted a solution in which only one image would have to be loaded per page and said image would be easy to interchange. Our goal was for the featured image of a page to be displayed as the header image.

We created the bellow PHP. It first identifies that the page is not the home page and has a featured image. Then, the current post thumbnail is set to the variable $imgID. We create a new variable titled $featuredImage which pulls the url from the current thumbnail. A div with class “featured-page-image” is then added in which the background is set to echo the url for the featured image.

The bellow CSS is then applied and we get the final result.

Bellow is an image of what the final product looks like.

featured-image-example

The 411 on me

411 Website Designer Jordan Iversen

Jordan Iversen is the CEO of Iversen Design, and is a native Santa Cruzian. In addition to designing websites and making your company look oh so pretty, I enjoy brewing beer & mead (honey wine), snowboarding, and dancing with my amazing wife.

Recent Posts

  • RW Garcia Snacks
  • Benevolent.ly
  • Compassion 2.0
  • Stone Soup
  • Del Monte Fence

Let’s be Friends

  • Facebook
  • LinkedIn
  • Twitter

Copyright © 2025 Iversen Design - Santa Cruz Website Designer