Home Forums Weaver Xtreme Theme show a slider, but only if its related filter has 1 or more items

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #75193
    Qoheleth
    Participant

    Is 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?

    #75194
    User
    Moderator

    @Qoheleth

    1) 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.

     

    #75195
    Qoheleth
    Participant

    It’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=worship

    The second filter shows all the posts in a specific category in Descending Date order:
    category_name=featured-2nd

    The 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.

    #75196
    scrambler
    Moderator

    This 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.

    #75204
    Weaver
    Keymaster

    Perhaps 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.

     

    #75205
    Qoheleth
    Participant

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.