Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1084737

    Recently I needed a solution to preselect Masonry portfolio grid filtrable category via incoming link #tag. That would enable me to make only one filtrable portfolio grid gallery, and then preselect the needed category simply utilizing #link in the form: site.com/page/#category

    Adding this filter to functions.php would enable exactly that:

    function select_portfolio_filter(){
     ?>
     <script type='text/javascript'>
     jQuery( window ).load(function() {
     portfolio = window.location.href.split('#')[1];
     jQuery('.'+portfolio+'_sort_button').click();
     });
     </script>
     <?php
     }
     add_action('wp_footer', 'select_portfolio_filter', 100);

    I hope this feature could be added to Enfold core, as it is incredibly useful.
    I actually paid for development of this filter, but as Enfold is such a phenomenal theme I am giving back to it.

    #1085673

    Hey,

    Thanks for your sharing your solution. We will share your request with our devs.

    Best regards,
    Yigit

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.