-
AuthorPosts
-
June 9, 2016 at 9:41 pm #645773
Hello,
I want to replace arrows with dots in postslider shortcode.
I make copy of function slide_navigation_dots(), change $entry_count by count($this->entries->posts) (got number of posts), but don’t know how to get count of columns.
When I’m provide custom variable $columns = 4 – all working fine, but want control this parameter from builder.
Thank youJune 12, 2016 at 11:08 am #646838Hey mdxclr,
Have you tried using the function found in contentslider.php:
protected function slide_navigation_dots() { $html = ""; $html .= " <div class='avia-slideshow-dots avia-slideshow-controls'>"; $active = "active"; $entry_count = count($this->config['content']); $slidenumber = $entry_count / (int)$this->config['columns']; $slidenumber = $entry_count % (int)$this->config['columns'] ? ((int)$slidenumber + 1) : (int)$slidenumber; for($i = 1; $i <= $slidenumber; $i++) { $html .= "<a href='#{$i}' class='goto-slide {$active}' >{$i}</a>"; $active = ""; } $html .= "</div> "; return $html; }
Best regards,
JosueJune 13, 2016 at 12:24 pm #647304Yes, variables for count of content and columns in this 2 sliders are different.
How to get count – I found (in my first post you can see what i change), but can’t find how to get columns.June 16, 2016 at 5:23 am #648995Hi,
Yes, variables for count of content and columns in this 2 sliders are different.
How to get count – I found (in my first post you can see what i change), but can’t find how to get columns.I’m sorry but I’m not sure what you mean by that. You can control the column options in the post slider settings.
Best regards,
IsmaelJune 16, 2016 at 3:54 pm #649284Yes, but after this I need to call count to my custom function (default there is no DOTS nav in postslider) copied from contentslider.
So I need variable, because (int)$this->config[‘columns’] doesnt work.June 20, 2016 at 3:44 am #650557Hi,
I see. Replace the whole function with this:
protected function slide_navigation_dots() { $html = ""; $html .= " <div class='avia-slideshow-dots avia-slideshow-controls'>"; $active = "active"; extract($this->atts); $entry_count = $items; $slidenumber = $entry_count / (int)$columns; $slidenumber = $entry_count % (int)$columns ? ((int)$slidenumber + 1) : (int)$slidenumber; var_dump($items); for($i = 1; $i <= $slidenumber; $i++) { $html .= "<a href='#{$i}' class='goto-slide {$active}' >{$i}</a>"; $active = ""; } $html .= "</div> "; return $html; }
Go to line 482 and call the function to render the dots:
if($post_loop_count -1 > $columns && $type == 'slider') { $output .= $this->slide_navigation_arrows(); $output .= $this->slide_navigation_dots(); }
Best regards,
IsmaelJune 30, 2016 at 6:35 pm #655426Great, thanks
-
AuthorPosts
- The topic ‘Dots in postslider shortcode’ is closed to new replies.