Okay
  Public Ticket #912230
random portfolio order
Closed

Comments

  •  2
    Manege started the conversation

    Hi there, 

    I just setting up my new portfolio page and I want the portfolio order be random on every new load. Can you help me with that? 

    Thanks, 

    Rainer

  •  1,558
    Laborator replied

    Hi Rainer,

    Can you please share your site credentials here, because we need to login to your site and see this issue live. Your information is safe (private) in this thread.

    To include your credentials click Insert Credentials button in editor toolbar. (See how)

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •   Manege replied privately
  •  1,558
    Laborator replied

    Hi Rainer,

    I fixed it by adding the code below in the functions.php file:

    function random_portfolio_order( $query ) {
        $query['orderby'] = 'rand';
        return $query;
    }
    
    add_filter( 'kalium_portfolio_pre_query', 'random_portfolio_order' );
    

    but it would be better if you use the Kalium Child Theme and paste this code in the functions.php of the child theme so it won't be lost on every update.

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  2
    Manege replied

    Hi Art, 

    works perfect, thank you for the support. 

    Best, 

    Rainer

  •  1,558
    Laborator replied

    Glad to hear that Rainer,

    If you like our theme, it would help us a lot if you could give us five star rating on themeforest from your Downloads tab, (if you don't know how, just open this link).

    A huge thank you from Laborator in advance, and have a great weekend! 

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  2
    Manege replied

    Just one more thing. 

    I have set up another portfolio page where I only show one random portfolio item. 

    But the Image is somehow blurry and I am not sure why. 

    Also is it possible to remove the hyperlink from the image on this page? 

  •  1,558
    Laborator replied

    Hi there,

    Can you please send the URL of this page first, so we can investigate your site and then get back to you with possible solution.


    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  2
  •  1,558
    Laborator replied

    Hi Manege,

    When I set the image size to original it inherited the size from the Theme Options so now it is showing good, do you want to keep also your projects with original image size? It will take more time to load the images.

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  2
    Manege replied

    Hi Art, 

    thank you so far. Here is what I have in mind for the site: 

    The "start" page should be my index page showing one random image. The possibility to click the image to show it in fullscreen should be removed. 

    The indes page right now should be my project page, showing all projects as a gallery. I don't know where to set the image size for this images. Of course I want them in a good quality when I click them to fullscreen but on the project page they don't have to be fullsize. 


  •  1,558
    Laborator replied

    Hi again,

    I added this code:

    // Start page load large images
    function portfolio_thumb_size_for_start_page( $size ) {
        $page = get_queried_object();
    
        if ( 'start' == $page->post_name ) {
            return "original";
        }
        return $size;
    }
    
    add_filter( 'kalium_portfolio_loop_thumbnail_size', 'portfolio_thumb_size_for_start_page' );
    

    In the functions.php file, so it shows original size for the start page while the other pages it shows normal photos not the original ones.

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  2
    Manege replied

    Hi Art, 

    thanks a million, works great. One last thing and we are done. Can you please remove the link on the image on "start" page so there is just the image without the ability to click it? 

    That would be great, thanks again. 

    Rainer

  •  1,558
    Laborator replied

    Hi Manage,

    Adding the CSS code below in the Custom CSS area of that page will disable clicking on the image:

    .portfolio-holder .item-box .photo a {
        pointer-events: none;
    }
    

    While adding the code will disable clicking on the image and in the title:

    .portfolio-holder .item-box .photo a,
    .portfolio-holder .item-box .info h3 a {
        pointer-events: none;
    }
    

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  2
    Manege replied

    Everything works great now, thanks again. 

    I just rated it 5 stars...

  •  1,558
    Laborator replied

    Glad to hear that Manege, I will close this ticket now

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group