Forum Replies Created
-
AuthorPosts
-
Hi,
Thank you for your help, I was able to get closer to the final solution. I have added the following to overwrite parent theme postslider.php in child theme folder:function slide_navigation_arrows(){ $number_of_go_to = ceil($this->entries->found_posts / $this->atts['columns']); $buttons = ''; for ($i = 1; $i <= $number_of_go_to; $i++) { $buttons .= '<a href="#'.$i.'" class="goto-slide">'.$i.'</a>'; } $buttons = '<div class="avia-slideshow-dots avia-slideshow-controls">'.$buttons.'</div>'; $html = ""; $html .= "<div class='avia-slideshow-arrows avia-slideshow-controls'>"; $html .= "<a href='#prev' class='prev-slide' ".av_icon_string('prev_big').">".__('Previous','avia_framework' )."</a>"; $html .= "<a href='#next' class='next-slide' ".av_icon_string('next_big').">".__('Next','avia_framework' )."</a>"; $html .= "</div>"; $html .= $buttons; return $html; }
there were some missing closing div from your solution which I fixed. I then added the following to child theme functions.php
function select_post_slide(){ ?> <script> jQuery(window).load(function(){ var columns = jQuery(".avia-content-slider").data("interval"); jQuery(".avia-content-slider .slide-entry-wrap .slide-entry").each(function( index ) { var postLink = jQuery(this).find("a").attr("href"); var thisURL = window.location.pathname; if(postLink.indexOf(thisURL) != -1){ var slide = (index / columns)+1; $(".avia-slideshow-dots a[href='#"+slide.toFixed()+"']").click(); } }); }); </script> <?php } add_action('wp_footer', 'select_post_slide'); ?>
This worked as expected, however there is a delay i.e. the post slider is shown and then the click happens after. Is there a way to do this click before the slider is shown to avoid the “flicker”?
Thanks for all your help!
- This reply was modified 6 years, 1 month ago by DigiCosmicAngel.
Hey! thanks for your help, however I believe you are referring to the “Easy Slider”? as the HTML structure is different for the “Post Slider”.
I used the following in the functions.php<?php function updatePostEntry(){ ?> <script> jQuery(document).ready(function(){ jQuery(".avia-content-slider .slide-entry-wrap .slide-entry").each(function( index ) { var postLink = jQuery(this).find("a").attr("href"); var thisURL = window.location.pathname; if(postLink.indexOf(thisURL) != -1){ $(".slide-entry-wrap").removeClass("active-slide").attr("style","visibility: hidden; z-index: 2; opacity: 0; transition: none 0s ease 0s; transform: translateZ(0px);"); $(this).parent(".slide-entry-wrap").attr("style","visibility: visible; opacity: 1; transition: none 0s ease 0s; transform: translateZ(0px); z-index: 3;"); } }); }); </script> <?php } add_action('wp_footer', 'updatePostEntry'); ?>
It worked, however the 2 slide-entry-wraps are overlapping each other (see screenshot) and it still does not solve the navigation issue.
-
AuthorPosts