Passer la navigation

[Résolu] Hiding navigation arrows on slideshow

This support ticket is created Il y a 1 week, 1 day. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 15 réponses, a 1 voix.

Dernière mise à jour par shannonM-4 Il y a 4 days, 3 hours.

Assisté par: Minesh.

Auteur
Publications
#2865020
screenshot 2026.06.15 at 11.04.08@2x.png

Hi there,

We have a custom Image field that can accommodate multiple instances (values).

A view displays the imagery in a slideshow. The question: when we have only a single image, is it possible to hide the navigation arrows (as seen in the attached screenshot circled in red)?

Thanks.

Saul

#2865028

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes - it could be possible but it may require custom JS.

Can you please share problem URL where I can see the issue as well as admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2865170

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

I need a bit more inforamtion here. I checked the custom field structure where you have a custom field "homepage-slidesho" and you also have checkbox "show-on-homepage".

I would like to know at a time only one agency post will have "show-on-homepage" or you will have multiple "show-on-homepage" agency posts?

#2865179

Hi Minesh,

Thanks for your reply.

Regarding which Agencies appear on the homepage, multiple Agency posts may have the "show on homepage" checkbox ticked, but when the homepage loads, custom code randomly selects just one of the posts, therefore only one Agency post will ever display on the homepage.

Saul

#2865182

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

ok - where you added that custom code that seleccts what posts to show?

#2865189

The code is located in wp-content/plugins/bet-cares-plugin/src/block_variations.php. I had forgotten it was using block bindings. The method you're interested in is filter_homepage_featured_agency_slideshow() on line 418. The slideshow code is using a view named "view-of-homepage-featured-agency-slideshow."

If you need to install a file browser plugin like File Manager (https://wordpress.org/plugins/wp-file-manager/), you have my permission. This is a copy of my production site, and you can do whatever you like to it.

#2865191

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

I've a little question - why you use such custom code as the view it self offers the order by feature to display random post.

If you check the view's ordering section - with the fist dropdown you can select the option random order.
- lien caché

#2865195

Minesh,

Thanks for your question.

The answer is that I'm using block bindings to connect multiple pieces of content to a WordPress block, the Cover block. Basically, I wanted the Agency name, Agency excerpt, Agency URL, and Agency slideshow to be displayed in the Cover block. It seems a bit insane, but I created it for another project and it was easy to adapt here.

I suppose it's dawning on me that I could have just used a View and created the layout using the Cover block in the block editor. Is that what you're getting at?

Saul

#2865518

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Yes - what I suggest is simple create a view order by random order and display 1 post only. If you do not want to do that please let me know and I will provide you further guidance.

#2865524

Minesh,

Let me see if I can create the view you suggested.

Thanks for your patience.

Saul

#2865575

Minesh,

Thanks to your sage advice, I replaced a bunch of PHP with a new view that randomly selects an Agency. Nice! (Note that only one Agency post has the special checkbox "Show on Homepage" checked, so the same Agency post gets randomly selected each time.) The new view is named "View of Homepage Random Featured Agency." It references a child view which displays the gallery slider, "View of Homepage Featured Agency Slideshow."

What's the next step to hide the navigation arrows?

Saul

#2865632

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

You do not need to nest the view as its not needed.

You can use the following top level view only "View of Homepage Random Featured Agency":
=> lien caché

I've added the following line of code to hide the navigation with "Loop Editor" section's CSS box:

.glide__arrows { display:none; }

You can adjust the loop output as required - see the result. You may add grid block and divide the display slider in left column and in right column you can display whatever you want and adjust it accordingly.
- lien caché

#2865635

Minesh,

Thank you for taking a look at the view. I think I *do* need the two different views since the other related information—Agency name, link, and brief description—got removed! And that's OK, it's just a test site. 🙂

As for the CSS, thank you for providing it. Is it correct that the navigation arrows are now removed regardless of the number of images in the slideshow? What I'm trying to accomplish is to remove the arrows only when there is a single image in the Homepage Slideshow field, because navigation isn't needed then. Does that make sense? Side question: can I use views shortcodes (https://toolset.com/documentation/programmer-reference/views/views-shortcodes/) in the CSS editor box?

Saul

#2865637

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

You do not need second view. Please check the following:
- lien caché

This is the view's template and I've added the grid block and set the grid to display two columns and you can display whatever you want accordingly. With left column I've added slider and in right column I've added the post link.
- lien caché

Please check the following Doc:
- https://toolset.com/course-lesson/responsive-columns-and-grids/

#2865665

Minesh,

Ah, I see what you mean now! I can replace the nested view with the "Image Slider" Toolset block. Cool!

Some questions for you:

+ Regarding the CSS to hide the navigation arrows, is it correct that the navigation arrows are now removed regardless of the number of images in the slideshow? What I'm trying to accomplish is to remove the arrows only when there is a single image in the Homepage Slideshow field.

+ On the Views editing screen, can I use views shortcodes (https://toolset.com/documentation/programmer-reference/views/views-shortcodes/) in the CSS editor box?

Saul