简体   繁体   English

在wordpress主题中动态添加图像

[英]dynamic adding images in wordpress theme

i am working with my footer to add many images in my wordpress theme, I want it to be dynamic in my dashboard. 我正在使用我的页脚在我的wordpress主题中添加许多图像,我希望它在我的仪表板中是动态的。 In my code i have many image src with an id of divimg where i added my images static. 在我的代码中,我有许多图像src,其id为divimg,其中我添加了静态图像。

all i want is to make the image something like a loop or any to have a selection in my wordpress admin dashboard menu to upload images and it will be added in that div. 我想要的是使图像像循环或任何在我的wordpress管理仪表板菜单中选择上传图像,它将被添加到该div中。 Please provide me some to add in functions.php and call it in my div with img src id = divimg 请提供一些添加到functions.php并在我的div中使用img src id = divimg调用它

here is my static code : 这是我的静态代码:

<section id ="brand">
            <div id="wrapper">
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/atlanta.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/atmor.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/bestank.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/ebsray.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/era.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/firefly.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/fsl.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/joven.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/meijia.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/omni.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/panasonic.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/royu.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/state.png" />
                    <img id="divimg" src="<?php echo get_stylesheet_directory_uri(); ?>/images/thermo.png" />
            </div>
        </section>

Have you tried any plugin: - 你有没有试过任何插件: -

please check this widget 请检查这个小部件

https://wordpress.org/plugins/image-widget/screenshots/

you can add this widget from backend to the footer and add the images dynamically . 您可以将此小部件从后端添加到页脚并动态添加图像。

Thanks 谢谢

这可能是矫枉过正,但我​​使用“高级自定义字段”插件这样的东西https://wordpress.org/plugins/advanced-custom-fields/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM