Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #429639

    Is it possible to link from a button on one page, to a specific filered category on an Ajax portfolio gallery.

    For example: Linking form a page, which opens this page http://kriesi.at/themes/enfold/portfolio/portfolio-ajax/ but shows html instead of all?

    Many Thanks
    Regards
    Colin

    #430225

    Hey waveseven!

    Thank you for using Enfold.

    Create a button and add the url with the “psort” parameter using the portfolio category slug as the value.

    http://www.mysite.com/myportfolio?psort=html
    

    And then add this script in the functions.php file to trigger the sort button.

    add_action('wp_footer', 'ava_auto_click');
    function ava_auto_click() {
    	if ( $_GET["psort"] == "html" ) { 
    	?>
    		<script>
            (function($){	
                $(window).load(function() {
                    $('.html_sort_button').trigger('click');
                });	
            })(jQuery);
            </script>
            <?php
    	}
    }

    Cheers!
    Ismael

    #430241

    Hi Ismael

    Thanks for your reply. Does this mean I could do it for each category?

    For example:
    Can I link from one page to the filered category html and link from another page to the filtered category photography etc

    Many Thanks
    Regards
    Colin

    #430830

    Hey!

    Something like this should work.

    add_action('wp_footer', 'ava_auto_click');
    function ava_auto_click() {
    	if ( $_GET["psort"] == "html" ) { 
    ?>
    		<script>
            (function($){	
                $(window).load(function() {
                    $('.html_sort_button').trigger('click');
                });	
            })(jQuery);
            </script>
    <?php
    	} elseif ( $_GET["psort"] == "photography" ) {
    ?>
    		<script>
            (function($){	
                $(window).load(function() {
                    $('.photography_sort_button').trigger('click');
                });	
            })(jQuery);
            </script>
    <?php
    	}
    }
    

    As previously mentioned, you have to use the portfolio category slug as the value of the “psort” parameter in the url. So the url should look something like for the “html” items.

    http://www.mysite.com/myportfolio?psort=html
    

    And like this for the photograpy items:

    http://www.mysite.com/myportfolio?psort=photography
    

    Just make sure that the value psort parameter value is the same as portfolio category.

    Regards,
    Ismael

    #431316

    Thanks Ismael. I’ll try that

    Colin

    #431870

    Hey!

    Great, please let us know if it works out or not.

    Best regards,
    Rikard

    #605675

    Hi there!!
    I came here for the same reason and it also worked for me, but my question is that if it’s possible, when you click the trigger, to also scroll down to the section where the categories sorted are shown, because the link is quite higher than the portfolio.

    Thanks in advance!!!

    #606163

    Hey!

    it would require a huge amount of time and customization of the theme and that is why you would need to hire a freelance developer for this job.

    Best regards,
    Andy

    #609106

    Well thank you Andy, the scroll thing it is resolved, but is it possible in code not to load the page when you make click? if it is, please let me know I’ll manage the way.

    Thank you very much for your work, you are great guys!!

    G.

    #610570

    Hi,

    Can you post the link to your website please?

    Regards,
    Josue

    #611226

    Hi this is the link of the page:
    http://websyapps.es/bluegold_test1/es/proyectos/
    The trigger button is in angola country
    Thank you for all

    #611837

    Hey!

    Why are you setting a delay of 2000 after the sort is triggered?

                $("html, body").delay(2000).animate({scrollTop: $('#porfolio').offset().top }, 2000);
    

    Best regards,
    Josue

    #613628

    Sorry, I just copy-paste from a stack-overflow post and it worked, but actually I have no idea of what I’m really doing. So you can ignore it.

    So why is this question closed?

    • This reply was modified 8 years, 7 months ago by gofthet.
Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Linking to filtered portfolio (ajax)’ is closed to new replies.