Tagged: masonry element, sorting
-
AuthorPosts
-
June 27, 2019 at 10:04 am #1113854
Hey folks!
I have a masonry element on a page which is showing portfolio items, and those portfolio items have multiple sortable categories. That’s fine and works great on the page. What I’d like to do however is to figure out of there’s any way that I can link to this page, and have the portfolio items pre-sorted according to whichever category I’d like. So, say, I could have a link on another page saying “Photography”, which when clicked it loads the page with the masonry element, but with the Photography category pre-selected.
Is this possible? Would love if so. :)
June 28, 2019 at 11:43 am #1114214Hey chiliharstad,
Please have a look at the solution posted here
https://kriesi.at/support/topic/linking-to-filtered-portfolio-ajax/#post-430830Best regards,
VictoriaJune 28, 2019 at 3:02 pm #1114268Hi Victoria, thanks for the reply. Couldn’t find a thread like that when I searched, but just tried to implement the same and when the page that’s linked to loads, the filtering still isn’t in effect.
Portfolio categories visible on the page are Publikasjoner, Studentoppgaver, with slugs the same but lowercase, and two other categories.
/* * Add functions to allow prefiltering portfolio items from a link * https://kriesi.at/support/topic/linking-to-filtered-portfolio-ajax/#post-430830 * */ add_action('wp_footer', 'ava_auto_click'); function ava_auto_click() { if ( $_GET["psort"] == "publikasjoner" ) { ?> <script> (function($){ $(window).load(function() { $('.publikasjoner_sort_button').trigger('click'); }); })(jQuery); </script> <?php } elseif ( $_GET["psort"] == "studentoppgaver" ) { ?> <script> (function($){ $(window).load(function() { $('.studentoppgaver_sort_button').trigger('click'); }); })(jQuery); </script> <?php } }
June 29, 2019 at 2:23 pm #1114436Hi chiliharstad,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.