Home › Forums › Weaver Xtreme Theme › show a slider, but only if its related filter has 1 or more items
- This topic has 5 replies, 4 voices, and was last updated 1 year, 9 months ago by
Qoheleth.
-
AuthorPosts
-
November 25, 2024 at 01:09 UTC - Views: 22 #75193
Qoheleth
ParticipantIs there a way to only show a slider if its related filter has 1 or more items.
On my landing page, I have a slider that’s also show and I edit the widget that displays it to add an additional slider at certain times during the year.
I end up manually going in an adding a block with the second slider and then deleting it when it’s no longer needed. I’d like to be able to display it when the filter that fills it has at least one item and not display it if there the filter has zero items.
Can this be done? If so, how would I do it?
November 25, 2024 at 01:55 UTC - Views: 20 #75194User
Moderator1) Is it possible to let us have a url for the site?
2) Can you let us have the added code that you now use, and explain how that needs to be modified to meet your functional needs?
@Scrambler will need to comment.Regards.
November 25, 2024 at 02:50 UTC - Views: 25 #75195Qoheleth
ParticipantIt’s abysmally simple right now:
The widget has two Shortcode blocks as follows:
[show_slider name=latest-worship]
[show_slider name=featured-2nd]I manually remove the second block when I don’t need it and add it back when I do. (It’s basically seasonal items.)
The first filter shows the latest post in a specific category (by Descending Date order):
category_name=category_name=worshipThe second filter shows all the posts in a specific category in Descending Date order:
category_name=featured-2ndThe sliders display the results of their respective filters (one item, slide to the next, show slider as images, add links to images)
So, as I said, I manually remove the second block of the widget when I don’t want to show the seasonal featured items and add it back in when I do.
I’m wondering if there’s a way to hide the second slider if the filter is empty (no items).
URL is disciplesnet.org
Currently, the second slider is showing.November 25, 2024 at 05:31 UTC - Views: 15 #75196scrambler
ModeratorThis kind of conditional behavior would most likely need programming which is beyond the scope of this forum.
You may want to investigate other slider plugins to see if one could do the job.
November 26, 2024 at 00:06 UTC - Views: 11 #75204Weaver
KeymasterPerhaps you could put the 2nd slider into its own post, and try something with https://wordpress.org/plugins/whp-hide-posts/
this is a fairly unusual thing to need to do.
November 26, 2024 at 02:28 UTC - Views: 8 #75205Qoheleth
ParticipantYes. I agree that it’s a fairly unusual thing to want to do and really, it’s only a minor inconvenience.
I just wanted to check to see if I was missing something.I’ll try looking at hide posts and see if I can jerry-rig something.
-
AuthorPosts
- You must be logged in to reply to this topic.

