Features

Your space to request and vote on the best ideas

Hide Arrows if slides amount = 1

Hi!

first of all, thank you so much for your great Plugin, which I love to use!

However, I have one suggestion: I think it would make sense to automatically hide the arrows, when the amount of slides equals one. I know you are able to hide them via the Checkbox in the settings, but sometimes I just forget it – and it’s not really user friendly to show an arrow when there is no action behind it.

As I can’t think of any situation where it makes sense to show an arrow if there is only one image, I suggest to automatically untick the option when there is only one slide, or even disabling it.

Thank you for your consideration!

4 Comments

  1. Kevin Batdorf

    Hi,

    Sorry for the late reply! Just curious, why would you have a slideshow with one slide?

  2. lem1298

    Hi,

    no problem, thanks for replying at all!

    I use this plugin in combination with the “Ultra” theme by Andrew Misplon to create the header images/slider headers. Most of the times, I feature multiple images as a “slider header”…but sometimes I have to take down some images and am left with one image or just want to use a single image in the first place.

    • Kevin Batdorf

      Hi,

      I’m not sure it’s worth adding to the code, but you could just add this to your functions.php

      add_filter('metaslider_flex_slider_parameters', function ($options, $id) {
      	$args = [
      		'post_type' => 'ml-slide',
      		'post_status' => ['inherit', 'publish'],
      		'posts_per_page' => -1,
      		'tax_query' => [
      			[
      				'taxonomy' => 'ml-slider',
      				'field' => 'slug',
      				'terms' => $id
      			]
      		]
      	];
      	if (count(get_posts($args)) == 1) {
      		$options['directionNav'] = 'false';
      	}
      	return $options;
      }, 10, 2);
      
  3. lem1298

    Hi Kevin,

    thank you very much for your help, I appreciate it a lot!

    Linus

Submit a Comment