Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Random background image that changes on page refresh for Front Page 1
- add_action( 'wp_head', 'sk_front_page_1_background_image' );
- function sk_front_page_1_background_image() {
- // abort if Soliloquy is not active
- if ( ! function_exists( 'soliloquy' ) ) {
- return;
- }
- // "display" Front Page 1 slider - i.e., get the URL of random slide image using the soliloquy_output filter used earlier and store it in a variable
- $random_slide_image_url = soliloquy( 'front-page-1', 'slug', array(), true );
- if ( $random_slide_image_url ) { ?>
- <style type="text/css">
- .front-page-1 {
- background-image: url(<?php echo $random_slide_image_url; ?>);
- }
- </style>
- <?php }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement