I have a custom theme that for the latest posts displays the posts thumbnail. What I am looking to do is to check and if there is no thumbnail set then use the category's featured image. I could upload the images and use this:
if (!$photo) : $uploads = wp_upload_dir(); $photo = '<div class="related-content-box__photo" style="background-image: url(' . $uploads['baseurl'] . '/2017/01/' . $category_name . '.jpg' . ')"></div>'; endif;
What I don't like about this is that if I want to change one image of a category I have to upload all of them again and change the year/month of the folder.
So I have uploaded the images as featured images for the category themselves but how can I display them?