A
A
Alexey Chumachenko2018-10-09 16:03:25
WordPress
Alexey Chumachenko, 2018-10-09 16:03:25

How to display an image in wordpress using code?

Can you please tell me if it is possible to display an image in Vodpress through the code without uploading it through the admin panel?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alvvi, 2018-10-09
@alvvi

Can you please tell me if it is possible to display an image in Vodpress through the code without uploading it through the admin panel?

Depending on what you mean by "display image". Getting the URL to the image file that is in the theme folder is easy, displaying the image in the same way as WP gives it out, with all sorts of srcsets, is more difficult, because you will not have cropped / resized versions of images generated when loading media in WP, well, using standard WP functions, you cannot interact with such an image (because from the point of view of WP it does not exist).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question