Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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 you

    #646838

    Hey 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,
    Josue

    #647304

    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.

    #648995

    Hi,

    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,
    Ismael

    #649284

    Yes, 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.

    #650557

    Hi,

    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,
    Ismael

    #655426

    Great, thanks

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Dots in postslider shortcode’ is closed to new replies.