I have removed the call for the sidebar in all the page types I’d like (leaving it in the post.php as desired, and have a WordPress template for the no-sidebar pages, like so:

get_header(); ?>

<div id="primary" class="content-area">
    <main id="main" class="site-main" role="main">

        <?php while ( have_posts() ) : the_post(); ?>

            <?php get_template_part( 'template-parts/content', 'page' ); ?>

            <?php
                // If comments are open or we have at least one comment, load up the comment template.
                if ( comments_open() || get_comments_number() ) :
                    comments_template();
                endif;
            ?>

        <?php endwhile; // End of the loop. ?>

    </main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>

but cannot make it full-width. Tried this in CSS:

.page-template-nosidebar-page-php .entry-header,
.page-template-nosidebar-page-php .entry-content,
.page-template-nosidebar-page-php .entry-summary,
.page-template-nosidebar-page-php .entry-meta
{
  padding-right: 0;
  width:100%;
}

Can anyone tell where I am going wrong?

Read more here: Need my ‘No Sidebar’ Template to be full-width


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: