Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #426856

    Hello, I have this page: http://www.ericsmeets.nl/testserver/fotografie-portfolio/
    which includes different galleries. Is it possible to create a link to this page AND with a specific gallery open.
    (For example, with the ‘ARCHITECTUUR FOTOGRAFIE INTERIEUR’-gallery open.

    ThankS!

    #427405

    Hi,

    This could work, try adding the following code at the very end of your theme / child theme functions.php file:

    function add_custom_script(){
    ?>
    <script>
    (function($){
    
      function triggerPortfolio(){
    
        var clickdItem = window.location.hash.substr(1);
    
        setTimeout(function(){
          $(".grid-sort-container a.grid-image[href*='"+clickdItem+"']").trigger("click");  
        }, 350);  
      }
    
      $(window).on("load hashchange", triggerPortfolio);
      
    
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Then prefix a hash to link it to a specific portfolio item, like:
    http://www.ericsmeets.nl/testserver/fotografie-portfolio/#architectuurfotografie-interieur`

    Regards,
    Josue

    #427448

    Wow, you guys keep amazing me with great assistance! Thanks, it did the trick.

    #427601

    You are welcome, always glad to help :)

    Regards,
    Josue

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Create a link to an open gallery trigger portfolio ajax load’ is closed to new replies.