Slider in Pro Theme: read more link on whole image
- This topic has 1 reply, 2 voices, and was last updated 7 years, 5 months ago by Grace Themes.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
January 7, 2017 at 6:11 pm #2626TimoParticipant
Hi,
i’m trying to modify php code from the slider. i want that the whole image is linked to the same url as the read more button. how can i do this?
<div class="slider-main"> <?php $slAr = array(); $m = 0; for ($i=1; $i<11; $i++) { if ( of_get_option('slide'.$i, true) != "" ) { $imgSrc = of_get_option('slide'.$i, true); $imglink = of_get_option('slidelink'.$i, true); $slidebutton = of_get_option('slidebutton'.$i, true); $slideurl = of_get_option('slideurl'.$i, true); if ( strlen($imgSrc) > 10 ) { $slAr[$m]['image_src'] = of_get_option('slide'.$i, true); $slAr[$m]['image_button'] = of_get_option('slidebutton'.$i, true); $slAr[$m]['image_url'] = of_get_option('slidelink'.$i, true); $m++; } } } $slideno = array(); if( $slAr > 0 ){ $n = 0;?> <div id="slider" class="nivoSlider"> <?php foreach( $slAr as $sv ){ $n++; ?> #### here i want the picture is linked to url from button #### <img src="<?php echo esc_url($sv['image_src']); ?>" alt="<?php echo esc_attr($sv['image_title']);?>" title="<?php echo '#slidecaption'.$n ; ?>"/> <?php $slideno[] = $n; } ?> </div> <?php foreach( $slideno as $sln ){ ?> <div id="slidecaption<?php echo $sln; ?>" class="nivo-html-caption"> <?php if( of_get_option('slidetitle'.$sln, true) != '' ){ ?> <a href="<?php echo of_get_option('slideurl'.$sln, true); ?>"><h2><?php echo of_get_option('slidetitle'.$sln, true); ?></h2></a> <?php } ?> <?php if( of_get_option('slidedesc'.$sln, true) != '' ){ ?> <p><?php echo do_shortcode(of_get_option('slidedesc'.$sln, true)); ?></p> <?php } ?> <?php if( of_get_option('slideurl'.$sln, true) != '' ){ ?> <a class="button" href="<?php echo of_get_option('slideurl'.$sln, true); ?>"> <?php echo of_get_option('slidebutton'.$sln, true); ?> </a> <?php } ?> </div><?php } } ?> </div><!-- slider -->
January 8, 2017 at 3:15 am #2629Grace ThemesMemberHi Timo,
Please send your website URL and WordPress admin login details for temporary at [email protected] so we can make changes in code to link the slider image to the url
Regards
Grace Themes -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.