S
S
Sergey Defactov2018-03-25 12:49:14
PHP
Sergey Defactov, 2018-03-25 12:49:14

Image as background via php?

How to display image as background with this code?

<?php if(!empty($wo['story']['postFile'])) { ?>
            <?php
            $media = array(
                'type' => 'post',
                'storyId' => $wo['story']['id'],
                'filename' => $wo['story']['postFile'],
                'name' => $wo['story']['postFileName'],
                'postFileThumb' => $wo['story']['postFileThumb'],
            );
            echo Wo_DisplaySharedFile($media);
            ?>
       
        <?php } ?>

I try like this
style="background-image:url('<?php echo Wo_DisplaySharedFile($media); ?>')">

but does not display in html shows background-image: url((unknown));

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-03-25
@demon416nds

You still show what you actually output in html (copy from the source of the page in the browser)
and the Wo_DisplaySharedFile code will not hurt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question