D
D
Dmitry2016-09-21 17:18:33
CMS
Dmitry, 2016-09-21 17:18:33

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">

Interested in connecting through a tag with an indication of the class.
What function should be used in order to insert pictures with the subsequent ability to change them through the admin panel?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Yanchevsky, 2016-09-21
@ddimonn8080

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.

E
Evgeny Vlasov, 2016-09-21
@iamskodnik

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 question

Ask a Question

731 491 924 answers to any question