Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1432974

    Hi,
    On my website https://lehrlingsdays.at/ there is a portfolio grid.
    Is it possible to display a specific category when the page loads? By default, all portfolio entries are shown when the page loads. However, I do not want to display all of them; I only want to show the entries from a specific category. Is that possible?

    Thanks!

    #1433194

    Hi, can anyone answer me please?

    #1433425

    *push* this is urgent!

    #1433523

    Hi,
    Thank you for your patience, unfortunately this element doesn’t have this option, you can choose to only show the one category alone by choosing only one category, or if you want to enable many categories and have one selected first you can try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_script() { ?>
      <script>
    (function($){
      setTimeout( function() {
          var grid = $('#js_sort_items .sort_by_cat');
    
          if( grid ) {
              grid.find('a[data-filter="austria-trend_sort"]').trigger('click');
              console.log('click');
          }
      }, 800);
    })(jQuery);
    </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_script', 99 );

    This will click your “austria-trend” sort option on page load. You can change this to the item you wish and adjust the delay option (800) if you wish. I tested this on your page by injecting it in the browser and it working well.
    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

    #1433678

    It worked!! Thank you so much! :-)

    #1433683

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Topic: Portfolio Categories: Show a particular category on Load’ is closed to new replies.