Jeremy Zauder
asked 6 years ago

If someone clicks a text link (article title) in the news slider from the carousel list, it changes the slider’s image (and the resulting title in the main image is clickable to the article). I’d like to make each item in the list link directly to its relevant article, so that when someone clicks it, they are taken to the post page. Thanks for the help.

vnet
replied 5 years ago

news-slider

1 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>'; ?>

 

Jeremy Zauder
replied 6 years ago

Thank you so much! We will try it and let you know how it goes.

Powered by DW Question & Answer Pro