Page layout with sidebar, and single post in fullwidth

Dear Support Team,

My website (built on Renew) uses the Fullwidth layout all over.

Now I need to use a sidebar on one single page while keeping everything else in Fullwidth.

At this point, I guess I need to convert the general layout of the website to Content Left, Sidebar Right in Theme Option > Layout and Design > Content Layout.

By doing so, the sidebar configured in Appearance > Sidebar and Appearance > Widgets appear in my new page. So far so good. But now, also the single blog pages have a sidebar section on the right.

How could I disable the sidebar of the single blog pages? Maybe a CSS customization would cut it?

Thank you for your assistance once more

Kind regards,

David

Hello David,

Thanks writing in!

Please be advised that the “Content Layout” in X > Theme Options > Layouts and Design will be applied globally. Once it is set to fullwidth, all of the pages will become fullwidth. To use the “Content Left, Sidebar Right” layout while making the single blog post display in fullwidth, you will need to modify the template file. Since you have your child theme active and ready, please follow these steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?php

// =============================================================================
// VIEWS/RENEW/WP-SINGLE.PHP
// -----------------------------------------------------------------------------
// Single post output for Renew.
// =============================================================================

$fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );

get_header();

?>

  <div class="x-container max width offset">
    <div class="x-main full" role="main">

      <?php while ( have_posts() ) : the_post(); ?>
        <?php x_get_view( 'renew', 'content', get_post_format() ); ?>
        <?php x_get_view( 'global', '_comments-template' ); ?>
      <?php endwhile; ?>

    </div>

  </div>

<?php get_footer(); ?>

3] Save the file named as wp-single.php
4] Upload this file to your server in the child theme’s folder /wp-content/themes/x-child/framework/views/renew/

You will need to create the folder path since it does not exist in your child theme’s folder yet.

Please let us know how it goes.

Hi Rue,

Flawless solution!

I’ve to admit this is much cleaner and stable than a quick CSS trick. I had to tamper around a bit with my wp-single.php in my child theme (I already had some customisations there) but no issue whatsoever.

Now all single posts display in full width even though the rest of pages can show a sidebar (Example: https://www.staging1.2cameras1bucketlist.com/see-the-world-without-leaving-town/)

Thank you so much!

David

You’re welcome David!
We’re glad we were able to help you out.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.