Feature Idea/Request: Random Content in Image Slider (aka Custom Query Setting)

Viewing 15 posts - 1 through 15 (of 15 total)
  • #20344

    Hi Daniel
    I have a suggestion for the Custom Query Widget, when using it in the main page slider.

    – allow to choose as many pages/posts/categories/tags as you wish (like today, check)
    – set a constant integer as “max. Numbers displayed”
    – the Custom Query Widget then selects the “max. Numbers” and renders them out to the main page
    – if main page is reloaded, a different set of featured images is displayed, always based on “max. Numbers” and the chosen pages/posts/etc.

    What do you think? That would give us some more dynamic on the main page.
    Or is this already possible and I do not see the option?

    Thx for your thoughts.

    Daniel Tara

    In my 12 years of experience I have never seen a situation where displaying random content on a page actually made sense. What’s the advantage of some users seeing some content and other other content, unless of course you’re A/B testing? I doubt all your content is that good that it doesn’t matter what you’re displaying on the front page. There should always be a structure and logic in the content you are displaying, even if it’s related to the main content, its presence should still make sense. But here’s the deal: If you get 9 other people to approve of this feature I will implement it.


    Fair point Daniel, true for most websites.

    But let me explain a bit more in detail:
    – I am using the Enlightenment theme for a (personal) Travel site, something like a logbook/photobook
    – we have documented all our vacations over the last 8 years, from 4 week holidays, one week journeys, to weekend trips
    – so there are something around 50 or so unique travel items (pages)
    – all items have beautiful photos, each one has a very unique featured image and an introduction text
    – each of our trips is categorized in one of three main categories, each with its own teaser slider

    –> so actually the main top slider is used as a surprise element for us – just like “opening” a book on a random page…

    Got my idea? πŸ˜‰

    If that did not help…: PEOPLE PLEASE VOTE! *biggrin*

    Daniel Tara

    I get your idea. Personally I would showcase the 3 big categories on the front page and split each of those categories by other topics. Something like:

    • Urban exploration
      • London
      • Paris
      • Amsterdam
    • Wildlife
      • Africa
      • South America
      • Australia
    • Mountain Climbing
      • The Alps
      • Rocky Mountains
      • Himalaya
    Daniel Tara

    Can you post a link to your current website?

    Daniel Tara

    There is also a usability issue you need to take into account: Users may visit your website, find an article on the front page and then return later to find it’s no longer there. So they have to either browse through their history, which nowadays it huge even for the past day or search your website but my bet is they will repeatedly hit the refresh button.

    Having a lot of content is not a reason not to have a clear navigation structure. Are you larger than TripAdvisor.com? You may have an emotional attachment to all your documented travels but people won’t coming to your website curious were you’ve been the past year, they’ll be coming searching for precise topics like “What is there to do Moscow during the night?” or “What is there to see around Athens?”. Please correct me if I’m wrong.


    The users are not a problem, because the site will not be public. Just for me and my girlfriend, just a personal travel logbook.

    I will post the link in the next reply, please delete it after you received it… Everyone else who is interested in the site please let me know and we can organize some kind of access.


    As you can see…

    Big slider: “hard” selection of all travel events in 2014
    Further down, 3 sliders w/ the three main categories of trips we have defined for ourselves, in between the links to the category pages itself.

    So my idea is to spice the big slider up with some random surprise elements, even from the past so they are not forgotten πŸ˜‰

    Daniel Tara

    Well, you should have said that to begin with. You have put quite a bit of effort into that website to keep it private. The site description is causing an overflow in the navbar that forces the nagigation to stack under a “More” link.

    Here’s how you can make posts display in a random order:

    First create a child theme. Then paste the following function in the child theme’s function.php file:


    Thank you Daniel
    I will try this tonight as I need some quiet time for the coding πŸ˜‰

    The site description overflow I will fix as well, need to dig into the CSS things.
    Will let you know if I succeed.

    Hope you like my work with your awesome theme.


    Did the Tagline… πŸ™‚
    But I seem too stupid for the random function. Any hints Daniel?

    Daniel Tara

    Sorry, apparently the filter runs too early for the function I described. You’ll have to do a manual edit.

    Open core/functions/custom-queries.php and find this line:

    Right before it add this code:


    I still don’t get it Daniel.
    There is no change in Slider behavior.

    Daniel Tara

    I made a typo, here’s the correct code:


    Yay, there is randomness in (all) my sliders now, sweet!
    So I guess my goal now is to duplicate the Custom Query Slider functionality (e.g. make a Random Slider function) and add the current random function there?

    Thx so far!

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.