Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1485547

    Hello support team,

    I have set up a new website and I am having some problems implementing the desired layout.

    I would like to address the portfolio categories via the navigation (main menu>submenu), but in such a way that they are then also addressed/displayed as an AJAX portfolio. As it is now, the category is displayed, but then in the standard layout, where the sidebar is still visible on the right.

    Here is my page:

    #1485554

    Hey klick-design-rbh,

    Thank you for the inquiry.

    Unfortunately, it’s not possible to enable the AJAX portfolio feature on archive or category pages. You may need to create dedicated custom pages for your portfolio categories instead of using the default portfolio category template.

    Best regards,
    Ismael

    #1485588

    I had understood him differently. For example, if he opens the page : Link via the menu, then it should open directly in the opened ajax style.

    Versuch doch mal das in der child-theme functions.php:

    function trigger_click_on_ajax_categories(){
    ?>
    <script>
    (function($){
        $(window).on('load', function(){
            // Prüfen, ob das Element mit der Klasse 'grid-links-ajax' auf der Seite existiert
            if ($('.grid-links-ajax').length > 0) {
                setTimeout(function() {
                    // Sicherstellen, dass das erste Element vorhanden ist, bevor der Klick ausgelöst wird
                    const firstGridItem = $(".grid-links-ajax .grid-entry.first");
                    if (firstGridItem.length) {
                        firstGridItem.find('.grid-image').trigger('click');
                    }
                }, 300);
            }
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'trigger_click_on_ajax_categories');

    eventuell musst du das timing etwas erhöhen.

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