Community Forums › Forums › Archived Forums › General Discussion › Digital Pro – replace main page image with slider?
Tagged: digital pro
- This topic has 5 replies, 5 voices, and was last updated 8 years, 11 months ago by
Toon61.
-
AuthorPosts
-
May 16, 2016 at 4:31 am #185694
neilc
MemberI'm developing a site on Digital pro and the person I'm doing it for has now decided they want "the picture on the front page to move" - ie. a slider.
Given this image appears to be put in place and sized by a jquery, what is the easiest was to replace it with a slider to which the users can get access to to change the images/messages etc?
Thanks
May 22, 2016 at 2:29 am #186062Brad Dalton
ParticipantLink to your site please.
1. You would need to give the users access to plugin settings.
2. The code required to replace the image with a slider is not so simple and requires a tutorial.
August 15, 2016 at 12:32 am #191285Tal
MemberI'm wondering this also...
Is there a similar theme that will allow a slider/rotating images in place of the main front page image that would be easier to use?
August 15, 2016 at 11:11 pm #191353Genesis Developer
MemberI have pro tips for this. I used Genesis Responsive Slider plugin.
August 22, 2016 at 12:56 am #191755Brad Dalton
ParticipantIf you only want to replace the image with a slider and not display the widget content over the slider image, you can use the following code:
add_action( 'genesis_after_header', 'slider', 5 ); function slider() { if ( function_exists( 'soliloquy' ) ) { soliloquy( '81' ); } }And then remove the PHP code from the front-page.php file for the front-page-1 widget area and background image.
January 22, 2017 at 10:13 am #199795Toon61
MemberThe main thing the front-page-1 widget does is use a simple jQuery script to get an image and stretch it over the entire browser window. This script is called backstretch, and it uses a companion script to show the actual image: backstretch-set.
If you want more then 1 image to show in a slideshow manner, just alter the 'backstretch-set.js' that you can find in the 'js' folder of the child theme.I changed mine in something like this:
jQuery(document).ready(function($) { $(".front-page-1").backstretch([ "http://example.com/wp-content/themes/digital-pro/images/front-page-1_01.jpg", "http://example.com/wp-content/themes/digital-pro/images/front-page-1_02.jpg", "http://example.com/wp-content/themes/digital-pro/images/front-page-1_03.jpg" ], {duration: 3000, fade: 1750}); });The original file was this:
jQuery(document).ready(function($) { $(".front-page-1").backstretch([BackStretchImg.src]); });As you can see, I added some additional parameters for duration and fade time.
It is not a fancy solution with a nice dashboard GUI or using a third party slider plugin, and you have to edit this script whenever you like to change the images.
But it works!I came to this solution by looking at the original jQuery plugin's site (http://srobbin.com/jquery-plugins/backstretch/).
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.