1

I know I'm probably missing something really obvious, but the background image isn't pulling through...

<div style='background-image: url(<?php echo $blogImage; ?>");'>

I've also tried:

<div <?php echo "style='background-image: url($blogImage);'";?> >
3
  • 2
    have you var_dumped $blogImage to make sure it contains the value you're expecting? Commented Jun 4, 2019 at 9:47
  • First check should always be "Count your quotes", make sure they match Commented Jun 4, 2019 at 9:54
  • is this issuee solved? i'm having the same problem. Commented Apr 29, 2020 at 0:31

2 Answers 2

2

Syntax error Use this

<div style="background-image: url('<?php echo $blogImage; ?>');">

Hope this helps

Sign up to request clarification or add additional context in comments.

Comments

1

You have a missing " before the php opening tag. try to add it and check.

<div style='background-image: url("<?php echo $blogImage; ?>");'>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.