Tagged: enfold, portfolio grid, random
-
AuthorPosts
-
November 29, 2013 at 5:17 am #194603
Hi There,
I was slowly adding some test content into the theme and realise that it only display the Most Recent portfolio items, is there a way to display Random items that Exclude the current post item? Thanks!
Regards,
Robert ChaiNovember 29, 2013 at 10:19 am #194647Hi sgrobert!
You can change the order of the portfolio using this on functions.php:
function custom_post_grid_query( $query, $params ) { $query['orderby'] = 'rand'; return $query; } add_filter( 'avia_post_grid_query', 'custom_post_grid_query', 10, 2);Best regards,
IsmaelNovember 29, 2013 at 10:43 am #194655Hi Ismael,
So meaning I can’t do it through the Advanced Editor rather than through the Default Editor? In this case, I can’t edit the settings of the Post Grid though, do let me know if there is an alternative?
Regards,
Robert ChaiNovember 29, 2013 at 11:21 am #194683Hi!
You can do it on the Advance Layout Builder. It will sort the portfolio items on random order. Please try it.
Cheers!
IsmaelNovember 29, 2013 at 12:15 pm #194706Hi Ismael,
So may I just clarify that if I insert the above code, it will by default auto-random the default grid? Please do let me know. Thanks!
Regards,
Robert ChaiNovember 29, 2013 at 12:17 pm #194707Hi Ismael,
I’ve just tried and tested. Does looks like it works without additional codes. Thanks so much!
Regards,
Robert ChaiNovember 29, 2013 at 3:40 pm #194747Hi Ismael,
I realized that I do need the two types of sorting working on the same website, meaning RANDOM and MOST RECENT. Thus, would there be an alternative to have the choice of calling up either or within the Advanced Editor? Thanks.
Regards,
Robert ChaiDecember 2, 2013 at 5:56 pm #195378Hey!
No, unfortunately not as far as I know. The filter adds the random to the query for all queries so for right now since there isn’t a theme option available its either an all or nothing change.
I’ll add the idea for a future update for a random option within the shortcode options however.
Cheers!
DevinFebruary 10, 2014 at 6:26 pm #221778+1 for a random option ;)
Torsten
-
AuthorPosts
- The topic ‘Can the Portfolio Grid display a list of Random items instead of Recent items?’ is closed to new replies.
