Tagged: x
-
AuthorPosts
-
August 11, 2016 at 2:20 am #1126837
kateanitaParticipantHello, I already have my homepage designed using the fullwidth option (stack is renew.)
I want a sidebar on the archive and individual blog pages, but if I select the option to have a sidebar it ruins my homepage. Can I apply the sidebar on the right to the archive and blog pages only?
Site is http://dev.stapkodesign.com/
Thanks very much!
Katie
August 11, 2016 at 4:33 am #1126958
Paul RModeratorHi Katie,
Thanks for writing in!
You can add this in your child theme’s functions.php file.
function x_get_content_layout() { $content_layout = x_get_option( 'x_layout_content' ); if ( $content_layout != 'full-width' ) { if ( is_home() ) { $opt = x_get_option( 'x_blog_layout' ); $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' ); $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt; } else { $opt = x_get_option( 'x_archive_layout' ); $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt; } } elseif ( x_is_product() ) { $layout = 'full-width'; } elseif ( x_is_bbpress() ) { $opt = x_get_option( 'x_bbpress_layout_content' ); $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt; } elseif ( x_is_buddypress() ) { $opt = x_get_option( 'x_buddypress_layout_content' ); $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt; } elseif ( is_404() ) { $layout = 'full-width'; } else { $layout = $content_layout; } } else { $layout = $content_layout; } if ( is_singular( 'post' ) || is_archive() || is_home() ) { $layout = 'content-sidebar'; } return $layout; }Hope that helps.
August 11, 2016 at 10:39 am #1127335
kateanitaParticipantYou guys are the best! Thanks so much! Worked perfectly.
August 11, 2016 at 11:36 am #1127410
kateanitaParticipantHi – one follow up question – the sidebar on my individual post pages has different content even though I thought I had it setup correctly in the widgets area.
I have attached screenshots of how my options are setup and it’s correct on the blog archive page, but when you go to individual pages, there are additional widgets in the sidebar: http://dev.stapkodesign.com/a-helpful-podcast-from-valenti-international-find-someone-attractive-and-accomplished-like-you/
I’m not sure where these additional widgets are coming from – I want it to be the same as the archive page: http://dev.stapkodesign.com/blog/
Thanks!
Katie
August 11, 2016 at 11:36 am #1127411
kateanitaParticipantoops forgot to add attachments!
August 11, 2016 at 11:39 am #1127415
kateanitaParticipantNevermind I figured it out! The widgets for the individual blog pages are feeding from the “Main Sidebar”.
August 11, 2016 at 12:32 pm #1127483
JoaoModeratorHi There,
Thanks for letting us know.
If you need further help please get in touch!
Thanks
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1126837 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
