Hello.
Someone asked this below but the thread is locked, probably since it’s so old?
Anyway, I needed the random backgrounds to only work on the home page (or any single page) You could also make this work for more than one page.
This is what i did and worked for me.
Set up all of your backgrounds and make sure they are working first.
In the admin panel of WP, go to ‘appearance/random backgrounds’
At the bottom there is a link to: ‘Edit the CSS file’
Click on this and it will open the css to edit.
Incidently, you can only access this file via FTP (if you don’t use the link in the settings) as it doesn’t show in the ‘plugin editor’ via the admin panel as it’s dynamically generated to it’s own folder in WP-content/plugins/evonapluginconfig
Anyway, this is how the css looks originally:
img.evonabackground, div.evonabackground{
z-index:-999;
position:fixed;
top:0;
width:100%;
/*min-height:100%;*/
margin-left:0;
margin-right:0;
right:0;
left:0;
}
This is what I changed it to.
The only way I could get it to work was to hide all backgrounds first, which is the first css rule. I then had to undo this for my homepage, in this case page-id-5, with ‘display:unset’. Your page id will be different. The way I find them is to access ‘pages’ via wp-admin and hover over ‘view’ under the page you’re looking for. The page id will appear in the url at the base of your browser. I’m sure you’ll find them.
It’s also worth noting that I also didn’t want the backgrounds displaying on post pages either. This first rule turns off the backgrounds site-wide, which is what i wanted.
img.evonabackground, div.evonabackground {
display:none;
}
.page-id-5 img.evonabackground, .page-id-5 div.evonabackground{
display:unset;
z-index:-999;
position:fixed;
top:0;
width:100%;
/*min-height:100%;*/
margin-left:0;
margin-right:0;
right:0;
left:0;
background-position:center center;
background-size:contain!important;
}
The last two css rules worked better for me for sizing and responsiveness.
You could apply this to other pages at the same time but just copying and duplicating the selectors at the top, with a comma, and adding other page id’s. Like this
.page-id-5 img.evonabackground, .page-id-5 div.evonabackground, .page-id-27 img.evonabackground, .page-id-27 div.evonabackground
If you need the opposite of this; display on most pages but not a one or a few, it’s easier to just leave the original code as is but add something like this to hide on one;
.page-id-5 img.evonabackground, .page-id-5 div.evonabackground, .page-id-27 img.evonabackground, .page-id-27 div.evonabackground {
display:none;
}
This would display everywhere but these two pages.
I hope this helps. This plugin still works well in 2020 with WP 5.3.2
]]>I know this plugin is over 5 years old with no support but it still works well with WP 5.3.2 in 2020. I’ve used it a lot.
Great if you can update it but I’m happy as long as it keeps working.
Cheers
]]>I am using your plugin, but it needs some refactoring.
]]>Hello, I use the plugin to display events in backgrounds and I would like to add links to go to your pages associated with something like:
<a href="#"><div class="evonabackground" style="background:url('https://www.exemples.com/wp-content/uploads/2017/06/background-image.jpg') no-repeat center top;"></div></a>
Do you think it can work?
Thank you
Hi!
I was using this plug in on a multisite but discovered that the choosen background were showing on every site in the network. I didn’t go on to figure out what could be done since I just wanted to try the plugin. I’m jsut posting so that you know that this can happen.
Easy and good plugin othervise.
Hello ,
i’d like to know if it’s possible with this plugin to chose a specific background for a specific page, and post ? Or it is the same one for all pages and post ?
Alex
]]>I’ve been trying to find a good background manager plugin all afternoon, and this one has the benefit of working with the Wunderground (weather) plugin and the Announcement Bar (a way of easily posting announcements) plugin. The other background managers I tried didn’t play nicely with those plugins, so this automatically puts this one ahead of the others I tried.
However, this background manager doesn’t seem to do anything but display one single image when you load my site. With the name “Random Backgrounds,” I thought that it would randomly change backgrounds every so often but there does not seem to be any way of making that happen. Nor can I find a way of having a different background depending on which page is loaded. This allows me to have one background image for every page on my website, end of story.
What am I missing here?
My website (in case it matters): https://www.afwillowbay.com
]]>img.evonabackground {
z-index: -999;
/* Set rules to fill background */
min-height: 100%;
min-width: 1920px;
/* Set up proportionate scaling */
width: 100%;
height: auto;
/* Set up positioning */
position: fixed;
top: 0;
}
@media screen and (max-width: 1024px) {
img.evonabackground {
left: 50%;
margin-left: -960px; /* 50% */
}
}
I set this as my default css while using this plugin, should be useful for anyone else too.
]]>