Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1331072
    Rad
    Moderator

    Hi there,

    What error you’re getting? If we made mistake testing through admin, your site will go down until we fix it through FTP. Hence, it’s best to provide it ahead of time to avoid downtime. And we’re not sure what’s the real issue yes and it may take time either.

    Thanks!

    #1366272
    anzezala
    Participant

    Hi,
    hadn’t had time to work on this issue for a while. So to explain my problem again so we can start over. You successfully provided me with the code to have a side menu with product categories. But the categories menu is only visible when i am on my main shop page (index shop page). I would like to have the categories menu visible when i chose one of the categories.
    I have provided you pictures of the menu that i would like when i click on a categorie.
    Example: i clicked on “Likerji” categorie which you can see in the URL, but the categorie menu isn’t there. That is the problem if you could please help me out.

    #1366721
    Rad
    Moderator

    Hi there,

    Please add this code to your child theme’s functions.php

    add_filter('ups_sidebar', 'woocommerce_shop_sidebar', 9999);
    
    function woocommerce_shop_sidebar ( $sidebar ) {
    
    return x_is_product_category() || x_is_shop() ? 'SIDEBAR_ID' : $sidebar;
    
    }

    Then just replace SIDEBAR_ID with the ID of the sidebar you created at Admin > Appearance > Sidebar.

    Then add category widget on that sidebar.

    Hope this helps.

    #1367110
    anzezala
    Participant

    Hi,
    it didn’ work. I think a did everything as you said. I have this code already pasted in. That is the code that the original sidebar menu on shop index page works. Maybe the is something that we could change to make it work.

    Here is the code:

    function x_my_custom_widgets_init() {

    register_sidebar( array(
    ‘name’ => __( ‘My Shop Sidebar’, ‘__x__’ ),
    ‘id’ => ‘sidebar-my-custom-shop’,
    ‘description’ => __( ‘Appears on the index shop page.’, ‘__x__’ ),
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h4 class=”h-widget”>’,
    ‘after_title’ => ‘</h4>’,
    ) );

    }

    add_action( ‘widgets_init’, ‘x_my_custom_widgets_init’ );

    #1367560
    Rad
    Moderator

    Hi there,

    Have you customized the templates as well? Because you didn’t need that if not. That code is registering a new sidebar through coding but it’s the same as adding sidebar at Admin > Appearance > Sidebars without a code. You’ll only need that code if you will customize your template which needs another dynamic_sidebar() declaration. I need to see your current setup, would you mind providing your FTP credentials as well?

    To make it simple, just add sidebar through Admin > Appearance > Sidebars and pick the sidebar ID and add this code to your child theme’s functions.php with the ID.

    add_filter('ups_sidebar', 'woocommerce_shop_sidebar', 9999);
    
    function woocommerce_shop_sidebar ( $sidebar ) {
    
    return x_is_product_category() || x_is_shop() ? 'SIDEBAR_ID' : $sidebar;
    
    }

    No other coding is needed if you haven’t edited the templates yet.

    Thanks.

    #1367731
    anzezala
    Participant
    This reply has been marked as private.
    #1368121
    Rad
    Moderator

    Hi there,

    It should be okay now, please check how it’s implemented. I also disabled your custom wp-sidebar by renaming it, it’s not needed 🙂

    Cheers!

    #1368138
    anzezala
    Participant

    Thank you so much. Really appreciate it.

    #1368193
    Nico
    Moderator

    You’re welcome.

    Feel free to ask us again.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1321366 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>