Answer the question
In order to leave comments, you need to log in
How to insert an image in Wordpress with the ability to change it later from the admin panel?
Hello, how to insert an image in Wordpress?
I am engaged in (studying) landing pages on WordPress. First I connected all the images using the bloginfo() function, but in this way there is no way to change the images from the admin panel.
<img src="<?php bloginfo('template_directory'); ?>/img/icons/howWeDo_1.png" alt="" class="howWeDo__img">
Answer the question
In order to leave comments, you need to log in
Hello.
Options:
1. Make a shortcode for this
2. Use a Customizer
3. Use custom fields (from plugins, for example, Advanced Custom Fields )
4. You can also look for some hook that will allow you to substitute your class when inserting an image in the WordPress editor.
To do this, it must be inserted from the console. Those. it will be part of the post/page content. Classes can be written in shortcodes, for example. Also, for example, a picture can be a post thumbnail, etc.
Or you can make a separate settings page in the console and define images there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question