Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to set background image for a specific article
#1
I'm trying to put a logo as a background picture in "About Us" page. The logo always shows as a picture and not as a background picture. Anyone tried to do that?
Reply
#2
(2017-05-24, 08:37:21)omrseo Wrote: I'm trying to put a logo as a background picture in "About Us" page. The logo always shows as a picture and not as a background picture. Anyone tried to do that?

Code:
<style>
if(get_page_slug($echo=false) == 'about-us') {
echo 'body {background-image:url(PATH/TO/background.jpg)}';
}
</style>

Alex
Reply
#3
You have to set the background picture in your theme instead of your page. If it is only suposed to be active on one page, you can make a seperate template file, in the page edit screen you can set a different template per page.

There are other ways (custom field/component etc.), but this is the standard way I think.
Reply




Users browsing this thread: 1 Guest(s)