Sumon Hasan Sumon Hasan - 2 months ago 14
PHP Question

How do I include background images url in a wordpress plugin?

enter image description here

This is my wordpress plugin code. How to dynamic background-image URL in a WordPress plugin?

<?php
function active_qploader() {?>
<style type="text/css">
#preloader {
position: fixed;
left: 0;
top: 0;
z-index: 999;
width: 100%;
height: 100%;
overflow:visible;
background-color:#333;
background-image:url("images/test.png");
background-repeat:no-repeat;
background-attachment:center center;
background-position:center;
}
</style>
<?php
}

Answer

Please try this one, you need not mention there echo, just give please:

<?php echo plugins_url( 'images/test.png', FILE ) ; ?>