Tagged: x
-
AuthorPosts
-
December 2, 2016 at 12:17 am #1278439
nextstepsyepParticipantGreetings,
I’ve tried to locate the proper code to add a sidebar to my full width product category pages to no avail. I managed to get the width perfect by adding
.archive.woocommerce .x-main {
width: 75%;
}.archive.woocommerce .x-sidebar {
width: 20%to my Custom CSS. Unfortunately, when I tried to update my wp_sidebar.php file with this code
<?php
// =============================================================================
// VIEWS/INTEGRITY/WP-SIDEBAR.PHP
// —————————————————————————–
// Sidebar output for Integrity.
// =============================================================================?>
<?php if ( x_get_content_layout() != ‘full-width’ ) : ?>
<?php if ( function_exists( ‘is_shop’ ) && (is_shop() || is_product_category() ) ) : ?><aside class=”<?php x_sidebar_class(); ?>” role=”complementary”>
<?php if (x_is_shop() ) : ?>
<?php dynamic_sidebar(‘ups-sidebar-shop’ ); ?>
<?php endif; ?>
<?php if ( get_option( ‘ups_sidebars’ ) != array() ) : ?>
<?php dynamic_sidebar( apply_filters( ‘ups_sidebar’, ‘sidebar-main’ ) ); ?>
<?php else : ?>
<?php dynamic_sidebar( ‘sidebar-main’ ); ?>
<?php endif; ?>
</aside><?php endif; ?>
I got an error message. At one point, some text appeared in the space where my sidebar should have gone, but now there’s nothing.
Please help.
December 2, 2016 at 12:25 am #1278449
RupokMemberHi there,
Please provide your URL and show us a screenshot of the error message.
Thanks!
December 2, 2016 at 12:33 am #1278454
nextstepsyepParticipantAnd, while I’ve got your attention . . .
I somehow managed to add a second set of product categories to my shop page. Could you please teach me how to remove the second set?
Thanks!
December 2, 2016 at 12:41 am #1278463
Paul RModeratorHi,
Please provide us your site url so we can provide you with a tailored answer.
Thanks
December 2, 2016 at 7:44 am #1278756
nextstepsyepParticipantMy apologies Paul!
December 2, 2016 at 2:57 pm #1279193
RadModeratorHi there,
You can use filter and hooks to implement your custom sidebar. Like from here https://community.theme.co/forums/topic/woocommerce-product-category-sidebar/#post-242520
You don’t need to add or modify sidebar templates or CSS, just add the code to child theme’s functions.php
As for your other question, I checked it and I’m not sure what is the second set. Would you mind providing a screenshot?
Thanks!
December 3, 2016 at 3:23 pm #1280052
nextstepsyepParticipantGreetings Rad,
Thanks for the links! I searched through the knowledge base for hours and couldn’t find them.
This is the link that ultimately helped me get the sidebar on the left side of my category page. I’m still working on getting rid of that duplicate from my home page.
https://community.theme.co/forums/topic/sidebar-on-single-product-page-4/#post-170005
Here’s the code I replaced in my functions.php file:
function x_get_content_layout() { $stack = x_get_stack(); $content_layout = x_get_option( 'x_' . $stack . '_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_archive() ) { if ( x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) { $layout = 'sidebar-content'; } else { $opt = x_get_option( 'x_archive_layout', 'sidebar' ); $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt; } } elseif ( x_is_product() ) { $layout = 'sidebar-content'; } 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; } if ( is_page_template( 'template-layout-content-sidebar.php' ) ) { $layout = 'sidebar-content'; } elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) { $layout = 'sidebar-content'; } elseif ( is_page_template( 'template-layout-full-width.php' ) ) { $layout = 'full-width'; } return $layout; } add_filter( 'ups_sidebar', function ( $default_sidebar ) { $sidebars = get_option( 'ups_sidebars' ); foreach ( $sidebars as $id => $sidebar ) { if ( x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) { if ( array_key_exists( 'index-shop', $sidebar ) && $sidebar['index-shop'] == 'on' ) { return $id; } } } return $default_sidebar; }, 9999 );December 4, 2016 at 12:14 am #1280272
ChristopherModeratorHi there,
Please update your code in child theme’s functions.php file to :
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;Hope it helps.
December 6, 2016 at 12:13 pm #1283454
nextstepsyepParticipantGreetings Rod,
My apologies for the delay in providing a screen shot. I’ve been working on implementing the other recommendations you guys have been providing me with. A million thanks for all your help.
What’s Left To Do:
Here are the screenshots of the double sidebar, recent posts, and product pages.Double Sidebar – I’d just like to only have one of these on the main shop page
Recent Posts – I can see the posts perfectly well in the backend. It’s the front end that’s kinda wonky.
Sidebar on Product Page – I would like to remove this all single product pages.
December 6, 2016 at 10:42 pm #1284061
LelyModeratorHi There,
Would you mind providing us with login credentials so we can take a closer look on your settings? See attached screenshot for errors on your page. 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.
December 7, 2016 at 11:00 am #1284810
nextstepsyepParticipantThis reply has been marked as private.December 7, 2016 at 4:50 pm #1285221
RadModeratorHi there,
It looks like due to the previous customization you did on wp-sidebar.php, unfortunately, I can only check it through FTP. Would you mind providing your FTP login credentials as well?
The recent posts issue is due to custom code too.
Thanks!
December 7, 2016 at 6:56 pm #1285393
nextstepsyepParticipantThis reply has been marked as private.December 7, 2016 at 8:39 pm #1285512
nextstepsyepParticipantOMG! I suck so hard right now 🙁
I went back through my own archive and re-traced my steps. Lo, and behold, I found the answers you had already provided me to the questions I had months ago.
I’m so very, very sorry for wasting your time.
This totally got rid of my double sidebar…again!
https://community.theme.co/forums/topic/woocommerce-sidebar-function-for-full-width-page/#post-1065903Thanks X Fam!!!
XOXOXODecember 7, 2016 at 11:57 pm #1285677
Rue NelModeratorHello There,
We are just glad that you have figured it out a way to correct the said issue.
Thanks for letting us know!Best Regards.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1278439 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
