2
votes

I am looking for a way (a function or a filter) to add an image to my custom theme on Wordpress. I have tried searching for ways on Google and here on SO but failed to find an answer.

All I get is "How to add an Image/Logo on my Custom Theme" but it just shows how to add a custom logo to be used on the header, footer, login page, etc. What I am trying to look for is a way to add an image to the theme itself like in Twenty Nineteen theme below.

Theme Preview

I checked the code for the Twenty Nineteen theme to see how it was done but I can't seem to find the part where they added the code to theme image function/filter/css comment.

I am not new to creating custom themes in Wordpress. I am already familiar with using filters and creating functions to customize the theme. I know I can use the custom logo theme support in Wordpress for the image, but I just have no idea how I can use it (if it is a function or a filter). I just need help with this one. Thanks in advance! :)

1

1 Answers

2
votes

Just name the image as screenshot.png [ recommended image size (currently) is 1200px wide by 900px ] and put it on theme's top-level directory (where the style.css file is )

Refarence: https://codex.wordpress.org/Theme_Development#Screenshot