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

    Hello.

    1- How can I select a category to start when showing a portfolio ?

    Example: https://kriesi.at/themes/enfold/portfolio/portfolio-ajax/

    That shows “All” when you see the page. The problem is that I have hundreds of items so I need them to start with one category.

    So for example in that link how can I set it to start with “CCS” selected.

    2- How to create the same portfolio as this demo ?

    Example: https://kriesi.at/themes/enfold-2017/portfolio/portfolio-4-columns-centered-ajax/

    There you show the category in which you are at the left, all the categories at the right and the setup is different.

    Please let me know how to achieve both points. 1 and 2.

    Thank you.

    #1001611

    Hey peterolle,

    1 Here is a possible solution for you
    https://kriesi.at/support/topic/portfolio-sortfilter-by-catagory-on-load/#post-349205

    2 is just a portfolio grid added to the page with the slider or color section on top.

    Best regards,
    Victoria

    #1001620

    I tried it with no luck.

    My portfolio category slug is “g-2” and I added this:

    function add_custom_script(){
    	?>
    	<script>
    	(function($){
    		$('a[data-filter="g-2_sort"]').trigger('click');
    	})(jQuery);
    	</script>
    	<?php
    }
    add_action('wp_footer', 'add_custom_script');

    That should be the way to add it correct ?

    Thank you.

    • This reply was modified 6 years, 3 months ago by peterolle.
    #1001898

    Hi,

    You should add a timeout or document load check to your code like:

    
    function add_custom_script(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
        	$('a[data-filter="g-2_sort"]').trigger('click');
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');
    

    Best regards,
    Dude

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