HR HR
asked 6 years ago

Hi, we would like to make the listed urls in the main story scroller clickable too, not just the main one at the bottom; our users are trying to click there and are confused that the titles don’t click; how can that be done? (see screenshot)  http://imgur.com/oqzz4aM
Focus 1.0.8, WordPress 3.9.1

Thanks

 

3 Answers
DominicStaff
answered 6 years ago

To resolve this issue, you can open thecustom.js file in the folder path “dw-focus>/assets/js/custom.js”. Find the line 34, remove the following code:

   // Slide controls

   $('.news-slider .other-entry li').on('click',function(e){

       e.preventDefault();

       var t = $(this);

       t.closest('.news-slider').find('.carousel').carousel( t.find('a').data('slice') );

   });

– Open the dw-focus-slider.php file in the folder path “dw-focus>/inc/widgets/dw-focus-slider.php” find the line 142, replace the following code:


  <h2><a data-slice="<?php echo $i; ?>" href="#top-store-<?php the_ID(); ?>"><?php the_title(); ?></a></h2>

With new code:

  <h2><a data-slice="<?php echo $i; ?>" href="<?php echo the_permalink(); ?>"><?php the_title(); ?></a></h2>

 Then Find the line 83, replace the following code:

<?php the_post_thumbnail('slider-thumb');  ?>

With new code:

<?php echo '<a target="_blank" href="'.get_permalink().'">'.get_the_post_thumbnail( get_the_ID(), 'slider-thumb' ).'</a>'; ?>
HR HR
answered 6 years ago

Many thanks, it worked perfectly…
two supplementaries… do you recommend changing the code so that the posts open in a new window and not the same window as it does now (will it cause problems with focus or mobiles that can’t open new windows as tabs?)
secondly… those changes you specified are in the parent. So if I understand the system correctly, every time there will be a focus update we install, it might overwrite that fix; and if I made those changes in the child folder (if it is possible for .js files?)  then since code files (not CSS) are augmented by child, not replaced, does it mean it will make those files immune to future version upgrades from the parent and so we won’t get a “pure” upgrade but with those two files  dw-focus-slider.php and custom.js preserved as the old versions?  Just for my knowledge…
Thanks again for your support.

DominicStaff
answered 6 years ago

– To display on a new windows, you can open the dw-focus-slider.php file. find the line 142.
Replace the following code:

<h2><a data-slice="<?php echo $i; ?>" href="<?php echo the_permalink(); ?>"><?php the_title(); ?></a></h2>

With new code:

<h2><a data-slice="<?php echo $i; ?>" href="<?php echo the_permalink(); ?>" target="_blank"><?php the_title(); ?></a></h2>   

– At the moment, our theme does not support to edit .js file in the child theme, If you don’t want to lose all changes that you customized, before updating the latest version, please mark and copy all files that you edited, then update to latest version.

Powered by DW Question & Answer Pro