Limited Time Offer | Get 10% OFF on All Themes Package. Use Coupon Code GRC10 Buy Now

WordPress Website Templates

Find Professional WordPress themes Easy and Simple to Setup

inner banner

Slider in Pro Theme: read more link on whole image

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2626
    Timo
    Participant

    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 -->
    #2629
    Grace Themes
    Member

    Hi 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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.