Tagged: x
-
AuthorPosts
-
November 24, 2016 at 7:49 am #1269522
taqviParticipantHi
I am using icon stack but i am not able to add a sidebar in the woocommerce shop page, although sidebar is visible on all other pages including product pages. Please check the link.https://www.attixshoes.com/shop/
Best Regards
November 24, 2016 at 8:03 am #1269542
Paul RModeratorHi,
To add sidebar, you can add this in your child theme’s functions.php file.
function blog_index_sidebar($contents) { if ( x_is_shop() ) { $contents = 'sidebar-content'; } return $contents; } add_filter('x_option_x_layout_content', 'blog_index_sidebar');Hope that helps.
November 26, 2016 at 8:22 am #1271458
taqviParticipantHi
thanks for your reply, i am not using child theme can i add this to main theme funciton.php?Best Regards
November 26, 2016 at 2:57 pm #1271634
Nabeel AModeratorHi again,
It is not recommended to add any piece of code directly to the parent theme because all of your modifications will be overwritten when an X update is released, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Hope this helps!
November 27, 2016 at 7:46 pm #1272636
taqviParticipantHi
Thanks for your reply but I can not find child theme in the download package could you please tell me from where I can get the child theme?Best Regards
November 27, 2016 at 8:56 pm #1272668
LelyModeratorHi There,
On the dashboard of this forum, click child theme. You can download it from there. The link should is this:https://community.theme.co/child-theme/
Hope this helps.
November 28, 2016 at 8:01 am #1273160
taqviParticipantHi
Thanks for providing the download link, I have setup the child theme and insert the above mentioned code in the functions.php but now my site is broken and not showing menu and sidebar properly, Please check the following linkNovember 28, 2016 at 8:01 am #1273162
taqviParticipantBest Regards
November 28, 2016 at 8:24 am #1273185
JoaoModeratorHi There,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks
Joao
November 28, 2016 at 9:15 am #1273256
taqviParticipantThis reply has been marked as private.November 28, 2016 at 7:29 pm #1273967
FriechModeratorHi There,
You need to re-set the menu to be primary again, since you switched theme. The sidebar is there its just empty, please put a widget on it under Appearance > Widgets > Main.
Hope it helps, Cheers!
November 28, 2016 at 7:59 pm #1274008
taqviParticipantHi
Thanks, menu and sidebar sorted again but the problem which i discussed earlier is till remain, as i can not see sidebar at the shop or product pages. I have entered the above mentioned code in child/funcions.phpBest Regards
November 29, 2016 at 12:35 am #1274206
ChristopherModeratorHi there,
Only one sidebar should be assigned to each page, I unassisgned ‘Right’ sidebar and now ‘Main’ sidebar is displaying fine on shop page.
To add sidebar to product pages, add following code in child theme’s functions.php file :
//Add sidebar to single product // ============================================================================= if ( ! function_exists( 'x_get_content_layout' ) ) : function x_get_content_layout() { $stack = x_get_stack(); $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() || x_is_product() ) { $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_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; } endif; // Add custom sidebar to product page// //=================================================== add_filter( 'ups_sidebar', 'product_sidebar', 9999 ); function product_sidebar ( $default_sidebar ) { if ( x_is_product() ) return 'ups-sidebar-main'; //Must match the ID of your target sidebar return $default_sidebar; }Hope it helps.
March 17, 2017 at 7:13 am #1410940
taqviParticipantHi
Sorry i think i need some more support on this issue after a long time, As i have added a new woo-commerce product category but sidebar navigation and other widgets are not showing on this particular category although they are visible on other categories pages, could you please let me know what to do to fix it?new category link : https://www.attixshoes.com/product-category/boots/
March 17, 2017 at 6:49 pm #1411590
RadModeratorHi there,
What’s your login URL again? I tried logging it but it says it’s disabled.
Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1269522 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
