-2

I want to simply get my website url

I am using wordpress and I am editing some PHP file I just want to do:

echo '<div style="background:url('

and add the site url! (e.g www.something.com) and after that add the path to my jpg file (e.g /theams/layouts/images/somefile.jpg)

that is all I want! but no matter what I wrote: URL() site_url() $SERVER

I got error undefined

please help

Benoît Latinier
  • 2,062
  • 2
  • 24
  • 36
yaniv
  • 1
  • 1

1 Answers1

0

Try this:

$site_url = get_site_url();

echo '<div style="background:url(\''.$site_url.'/theams/layouts/images/somefile.jpg\');"></div>';
wrkman
  • 100
  • 1
  • 12