Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1133842
    hbedit
    Participant

    Hello,

    1) I know that it is not possible to show sub-categories in Woocommerce breadcrumb.

    But i would like to show at least the category, like that :

    Home > Shop > Category > product

    What is the right code to insert on my Icon theme, and where to insert it ? Is it in functions.php of my child theme ?

    2) I would like that the product page looks the same than the other pages (categories page, article page, etc.) whith the widget bar on the right.

    Actually the page is fullwidth.

    How can i do it ?

    Many thanks !

    #1133847
    hbedit
    Participant
    This reply has been marked as private.
    #1134484
    Friech
    Moderator

    Hi There,

    Thanks for writing in! Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

    Thanks for understanding.

    #1134894
    hbedit
    Participant

    Hello Friech,

    Thanks for your answer.

    I have tried different codes and i have found the right one on your support, witch allow to show also sub-categories on breadcrumb !!!

    For those who need that, here is the code to add to the functions.php file in the child theme. You need to use SEO Yoast plugin.

    if ( ! function_exists( 'x_breadcrumbs' ) ) :
      function x_breadcrumbs() {
    
        if ( x_get_option( 'x_breadcrumb_display', 1 ) && function_exists('yoast_breadcrumb') ) {
              yoast_breadcrumb('<p id="breadcrumbs">','</p>');
        } 
    
      }
    endif;

    It works perfectly for me !

    Best regards.

    #1135056
    Darshana
    Moderator

    Glad you were able to find the right solution and thanks for sharing it with other members.

    Cheers!

    #1135489
    hbedit
    Participant

    Hello Darshana, you are welcome, we all need to help each other.

    Anyway i realize that nobody has answered to my second question, could you take a look ?

    I paste it here :

    2) I would like that the Woocommerce product page looks the same than the other pages (categories page, article page, etc.) whith the widgets bar on the right.

    Actually the product pages are fullwidth.

    How can i do it ?

    Thanks !

    #1135579
    Rupok
    Member

    Hi there,

    Thanks for updating and sorry somehow that was overlooked. So you are trying to show sidebar on your single product page, right? It’s possible with some custom code as you can see on this thread – https://community.theme.co/forums/topic/icon-shop-help-show-sidebar-on-product-page/#post-267925

    Cheers!

    #1135751
    hbedit
    Participant

    Hello Rupok, it works perfectly, thank you !!

    I paste here the code to insert on the functions.php (child theme) file if somebody needs the same thing and read this thread :

    function x_get_content_layout() {
    
        $content_layout = x_get_option( 'x_layout_content', 'content-sidebar' );
    
        if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_singular( 'post' ) ) {
            $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
            $layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
          } elseif ( x_is_portfolio_item() ) {
            $layout = 'full-width';
          } elseif ( x_is_portfolio() ) {
            $meta   = get_post_meta( get_the_ID(), '_x_portfolio_layout', true );
            $layout = ( $meta == 'sidebar' ) ? $content_layout : $meta;
          } elseif ( is_page_template( 'template-layout-content-sidebar.php' ) ) {
            $layout = 'content-sidebar';
          } elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) {
            $layout = 'sidebar-content';
          } elseif ( is_page_template( 'template-layout-full-width.php' ) ) {
            $layout = 'full-width';
          } elseif ( is_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) {
              $opt    = x_get_option( 'x_woocommerce_shop_layout_content', 'sidebar' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            } else {
              $opt    = x_get_option( 'x_archive_layout', 'sidebar' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            }
          } elseif ( x_is_product() ) {
            $layout = 'content-sidebar';
          } elseif ( x_is_bbpress() ) {
            $opt    = x_get_option( 'x_bbpress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
        } else {
          $layout = $content_layout;
        }
    
        return $layout;
    
      }

    Best regards !

    #1135774
    Nico
    Moderator

    Hi There,

    Thank you so much for sharing the solution and we are very happy to hear that it is working great.

    Feel free to ask us again.

    Thanks.

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