Change portfolia images

Hello,

Thanks again for the great theme. I want to use the portfolio section to show pictures of events happend in the past. It looks very great but I need some modification.

  1. I really like to have the images showing in random order … so it changes everytime a visitor comes on the page. After reading a lot on the forum I did find a sollution for this issue. However it is not working so I am nog sure what i am doing wrong.

I did find this piece of code :

    /**
     * Enable random order of projects displayed in the widget
    */
    add_action('pre_get_posts', 'sydney_child_change_projects_order', 9999);
    function sydney_child_change_projects_order($query) {
      if( !is_admin() && !is_search() && !is_archive() && is_main_query() && $query->query_vars['post_type'] =='projects' ) {
        $query->set('orderby', 'rand'); // Random order
      }
    }

But the images keep in the same position. I use a childtheme but it looks like the function is not working. How to solve this.

  1. It would be awesome, when I have the random images to work properly to show a max of 10 pictures on the site. If possible with navigation dots or arows to go to the next ten images. When the Random order will work its okay to only show 10 images because people will see new ones everytime.

Is it possible to only have 10 images visible when uploading more?

Sorry for any bad english… I cannot provide you with an url since I am building on localhost first… and I cannot get ngrok to work.

Warm regards,

Jap

Hello Jap,

It looks like this issue requires some coding and testing, this goes beyond our support policy. It’s considered advanced customization. As an option, you can contact Codeable for this kind of service, or find a reputable freelancer on Upwork. Hope for your understanding.

Kind Regards, Roman.
aThemes Support

Hello,

Ok, I guess your answer is about question 2?

Can you tell me how I can show the pictures randomizes?

Some way I have the feeling the child theme is not working… because I grabbed this code above from your forum.

regards… Jap

Hello Jap,

That PHP snippet affects projects Custom Post Type that was used when Page Builder by SiteOrigin was the recommended page builder plugin. It won’t work with Elementor widget, unfortunately.

Kind Regards, Roman.
aThemes Support