Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #1440098

    Hi,
    I have some issues with my sidebar. It doesn’t respond to the settings in Sidebar Settings. At the moment I have no sidebar at all, but i would really like a left sidebar on all woocommerce category pages.

    As it won’t respond to the sidebar settings and has its own life, I have added the following code to my function.php file, but that is not a satisfying solution. I would really like the theme settings to work.

    add_filter(‘avia_layout_filter’, ‘avia_change_post_layout’, 10, 2);
    function avia_change_post_layout($layout, $post_id) {
    if( is_archive() ) {
    $layout[‘current’] = $layout[‘fullsize’];
    $layout[‘current’][‘main’] = ‘fullsize’;
    }

    return $layout;
    }

    Can you please help me out?

    #1440156

    Hey ditteditte,

    Thank you for the inquiry.

    We adjusted the avia_layout_filter filter a bit. Please replace the current filter with the following code:

    function avf_change_sidebar_layout($layout, $post_id)
    {
        if ( is_archive() && !is_product_category() ) {
            $layout['current'] = $layout['fullsize'];
            $layout['current']['main'] = 'fullsize';
        }
        return $layout;
    }
    add_filter('avia_layout_filter', 'avf_change_sidebar_layout', 10, 2);

    Best regards,
    Ismael

    #1440172

    Hi,
    Thank you for your reply. I tried to replace the filter, but making changes in sidebar settings still doesn’t respond.

    Further more my second category description (placed at the bottom of the page) crawl op in the sidebar. It might be a number thing that has to be ajusted.
    I added the second description with this code:

    // —————
    // 4. Display field under products @ Product Category pages

    add_action( ‘woocommerce_after_shop_loop’, ‘bbloomer_display_wp_editor_content’, 20 );

    function bbloomer_display_wp_editor_content() {
    if ( is_product_taxonomy() ) {
    $term = get_queried_object();
    if ( $term && ! empty( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) ) {
    echo ‘<p class=”term-description”>’ . wc_format_content( htmlspecialchars_decode( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) ) . ‘</p>’;
    }
    }
    }

    #1440261

    Hi,

    Thank you for the update.

    We tried to access the site, but it requires two-factor authentication. Could you please temporarily disable this feature so that we can access the dashboard and check the modifications? Make sure that the Appearance > Theme File Editor panel is accessible.

    Best regards,
    Ismael

    #1440291

    two-factor authentication is now disabled and Theme File Editor enabled.

    #1440335

    Hi,

    The functions.php file still had the older version of avia_layout_filter without the is_product_category conditional function. We’ve updated the code. Please review it again.

    Best regards,
    Ismael

    #1440338

    Hi,
    Unfortunately i still don’t se any changes. Product categories dosen’t react to changes made in sidebar settings. I can’t move the sidebar from right to left and I can’t hide the sidebar either.

    Try to make changes an see what happens on this page https://nederkjaersholm.dk/produkt-kategori/brugskunst/

    Further more the second category description still crawls op in the sidebar as described above.

    #1440487

    Hi,

    Thank you for the info.

    In our own installation, the sidebar position on the product category pages changes correctly when we adjust the Sidebar On Archive Pages settings. Have you tried temporarily disabling the plugins? You should also test this without the modifications in the child theme’s functions.php file.

    Best regards,
    Ismael

    #1440787

    Hmm I tried that whitout any effect.

    But I figured that it migt not be the “Sidebar On Archive Page” that is not responding, as I first thought, but instead it is the widget area called “shop overview page”.

    The widget area called “shop overview page” appears on all my product category pages as a right sidebar. Where do I control this sidebar? It migt not be part of the Enfold sidebar settings.

    #1440826

    Never mind i figured it out

    #1440854

    Hi,

    Thanks for the update. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

    #1440916

    Well I would still have this custom field displaying a second category description that I can’t display at the right place. It should be at the bottom af every category pages underneath the pagination, but at the moment it is too far down under the sidebar.

    Take a look at this page at the bottom: https://nederkjaersholm.dk/produkt-kategori/have-indretning/have-interioer/

    // —————
    // 4. Display field under products @ Product Category pages

    add_action( ‘woocommerce_after_main_content’, ‘bbloomer_display_wp_editor_content’, 11 );

    function bbloomer_display_wp_editor_content() {
    if ( is_product_taxonomy() ) {
    $term = get_queried_object();
    if ( $term && ! empty( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) ) {
    echo ‘<p class=”term-description”>’ . wc_format_content( htmlspecialchars_decode( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) ) . ‘</p>’;
    }
    }
    }

    #1440932

    Hi,

    Try to replace the woocommerce_after_main_content hook with woocommerce_after_shop_loop. This should render the description right after the product grid

    Best regards,
    Ismael

    #1440976

    That moved the description up in top of the sidebar. I then changed 11 to 10 which moved it down, but it went between the products and the pagination. So now I just need the pagination back up underneath the products.

    #1441254

    Hi,

    Thank you for the update.

    Try to replace the hook with woocommerce_after_shop_loop, then set the priority to 15.

    Best regards,
    Ismael

    #1441257

    Then It went up in the sidebar again.

    #1441391

    Hi,

    Sorry about that. We adjusted the hook a bit, then added this script to move the second description below the pagination.

    
    function ava_custom_script()
    {
        ?>
        <script>
            (function ($)
            {
                function moveTermDescription()
                {
                    if ($('.term-description-second').length && $('.pagination').length) {
                        $('.term-description-second').insertAfter('.pagination');
                    }
                }
    
                $(document).ready(function ()
                {
                    moveTermDescription();
                });
            })(jQuery);
        </script>
        <?php
    }
    add_action('wp_footer', 'ava_custom_script');
    

    Best regards,
    Ismael

    #1441402

    Great! Thank you!!!!!!! It looks nice!

    #1441546

    Hi,

    No problem! Glad it’s working. Please don’t hesitate to open another thread if you have more questions about the theme.

    Have a nice day.

    Best regards,
    Ismael

Viewing 19 posts - 1 through 19 (of 19 total)
  • The topic ‘Sidebar not responding’ is closed to new replies.