• Resolved ddewilt

    (@ddewilt)


    Hi,

    I’m surfing around on the web for a couple of days now to find out how to display 2 random images on my frontpage from template ‘x’ from gallery ‘y’, but I can’t get it to work. I’ve found a few options on this support page and the nextgen site, but none of them seems to work or either display the 2 random images.

    With the [random] shortcode it seems to display 2 images, but those are not random if I refresh te page, the same 2 images appear.

    So, can anybody tell me what peace of code I should use to get it to work?

    Thanks a lot!

    Greetings Daan

    https://www.ads-software.com/support/plugin/nextgen-gallery

    https://www.ads-software.com/plugins/nextgen-gallery/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @dewily – Have your tried something like this:

    [ngg_images gallery_ids=1 display_type=photocrati-nextgen_basic_thumbnails disable_pagination=1 images_per_page=2 show_all_in_lightbox=1 order_by='rand()']

    – Cais.

    Thread Starter ddewilt

    (@ddewilt)

    Hero!

    Thanks a lot!!

    Greetings Daan

    Plugin Contributor photocrati

    (@photocrati)

    @ddewilt – Glad to help!

    – Cais.

    Thread Starter ddewilt

    (@ddewilt)

    I don’t get it… your code seemed to work just fine, but when I wanna place my photo’s 20px outside my content it stops randomizing..?!?!?!

    What am I doing wrong?

    This is what I’ve put in the “nggallery.css”-file in the “wp-content” directory to get the 2 pictures beside each other.

    .ngg-gallery-thumbnail-box .ngg-gallery-thumbnail img {
        border: 0px;
        padding:0px;
    }
    
    .ngg-galleryoverview {
    
        width: 800px;
        margin-left:-10px;
        margin-top:-20px;
    }
    
    .ngg-gallery-thumbnail {
        margin-right:5px;
        margin-left:5px;
    }
    
    .ngg-gallery-thumbnail img {
    }

    Here the link to the page:
    https://www.winniz-uden.nl/winniz/

    Plugin Contributor photocrati

    (@photocrati)

    @ddewilt – Custom CSS would not affect the generation of the images in the display, it may just be coincidental that your adding custom CSS appears to have caused the randomness to stop working.

    Thanks!

    – Cais.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Random images doesn't work in any way’ is closed to new replies.