Display Thumbnails on the Frontend
Learn to display thumbnails on the frontend.
We'll cover the following
Display image on a teacher post
Now that the teacher post has an image associated with it, we can use it on the frontend. Open the single_teacher.php
file. We want to display the thumbnail image next to the content.
Inside the <div>
with CSS class generic-content
, we will add a <div>
with class image-and-text
. This class is responsible for displaying the content in two columns. The class column1
displays the content in one-third space while the class column2
displays the content in two-thirds space.
We will display the image on one-third of the screen using the the_post_thumbnail()
function and the content of the post on the remaining two-thirds.
Get hands-on with 1400+ tech skills courses.