Viewing 25 posts - 1 through 25 (of 25 total)
  • Author
    Posts
  • #7372

    Hi,

    How is it possible to randomize background photo on home page?

    Thank you

    #57691

    Hey,

    I’m not sure if this is (easily) possible but you can try following mod – open up includes/helper-slideshow.php and replace:

    $this->slides 		= avia_post_meta($this->post_id, 'slideshow');

    with:

    $this->slides 		= avia_post_meta($this->post_id, 'slideshow');
    if(is_home()){
    shuffle($this->slides );
    }

    #57692

    Dude, could you tell me how to randomize background photo on EVERY page ?

    I think it’s a little boring when guest sees always the same first photo. I’ve tried to make few galleries, different on every page but i’m not satisfied…

    #57693

    If the code provided by Dude works I believe you can do this like this:

    $this->slides 		= avia_post_meta($this->post_id, 'slideshow');
    shuffle($this->slides );

    #57694

    Sorry, also interested in randomizing the background gallery, but in helper-slideshow.php I can’t find the code provided by dude (Flashlight V 1.3) – where do I have to look? Thanks

    #57695

    Hey,

    it’s in includes/helper-slideshow.php – please search again (and use offline editors like notepad++). Maybe try to search for some text parts only.

    #57696

    Sorry, again not found. Searched in offline-editor for slide, meta, $this, post_id but nothing found which nearly matched your given code. Which line do you mean? (Flashlight V1.3 – includes/helper-slideshow.php)

    #57697

    I have searched whole folder by notepad++ and nothing found :(

    #57698

    Ok – I’m sorry. Something changed V1.3 in includes/helper-slideshow.php search for:

    foreach($attachments as $key => $attachment)

    and replace it with:

    shuffle($attachments );
    foreach($attachments as $key => $attachment)

    #57699

    That’s it, now it works fine! Thanks!

    #57700

    Glad that I could help you :)

    #57701

    Yes, it works fine :) but why only at start page ? I’ve set default gallery at every page… Is it possible to set it to the whole pages ?

    #57702

    OK it works :) But is any other way to randomize default background gallery ? Unfortunately this way it shuffles every gallery (portfolio, blog).

    #57703

    Allright, I solved the problem with default gallery at homepage only – I made some mistake when I moved blog form /blog folder one level up.

    Do you have any idea how to randomize background gallery without randomize gallery at my blog ? Right order photos in my blog is very important form me. I’ll be really thankful :)

    #57704

    I haven’t tested it but try following – in template-blog.php replace:

    get_template_part( 'includes/loop', 'index' );

    with:

    $avia_config['currently_viewing'] = 'blog';
    get_template_part( 'includes/loop', 'index' );

    and replace:

    shuffle($attachments );
    foreach($attachments as $key => $attachment)

    with:

    global $avia_config;
    foreach($attachments as $key => $attachment)
    if($avia_config['currently_viewing'] != 'blog'){
    shuffle($attachments );
    }
    foreach($attachments as $key => $attachment)

    #57705

    Unfortunatelly still the same :(

    #57706

    Did you set your blog page via the Flashlight option panel?

    #57707

    Yes, I did. Does it matter if it site name begins from a capital letter ?

    #57708

    I just saw that Kriesi doesn’t call the avia_config variable. I changed the code above a bit. Please try it again.

    #57709

    It doesn’t work :(

    You can see it at http://krzysztof-krawczyk.com

    I checked it twice. Blog page is set to blog in Flashlight menu.

    Try to visit my portfolio and blog sub-pages. Images in galleries are still mixed :( Background default gallery works fine – I really like it :)

    #57710

    Then I think it’s not easily possible because wordpress doesn’t offer an option to determine the blog page. It would require some framework changes…

    #57711

    Hmmm… that’s interesting… I was trying other galleries and it seems that it works only at WordPress Default Gallery attached to the entry. Maybe this way it looks less interesting but it works like I wanted it to :)

    Anyway thanks to you for help!

    #57712

    Hello,

    Jacking a thread as opposed to starting completely fresh as its almost the same request.

    Is there a way to have the Default Background Image Gallery use only the featured images from each Post automatically, and If not, is it possible to suggest it as a possible feature for a future update?

    #57713

    Hi,

    I have put:

    shuffle($attachments );

    foreach($attachments as $key => $attachment)

    But would actually like the default gallery or home page only to be shuffled… !

    >> It would be great to have a “shuffle option tick box” when making the galleries… if by any chance it could be part of a future update of Flashlight !

    Regards

    Alex

    #57714

    Hey alexthefunk,

    Let me tag this to Kriesi.

    Regards,

    Ismael

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

The topic ‘Random photo’ is closed to new replies.