Ced Newsresources
asked 11 years ago

Hi,
Could you help to hide the right sidebar for a single blog post ?
On single.php I can delete
<div id=”secondary”>
<div class=”secondary-inner”>
<?php get_sidebar(); ?>
</div>
</div>
 but of course it’s not alright as the sidebar is replaced by a… white space ^^
Is there a way to call the template menu+content (page_layout_3) ?
Thanks a lot,
Cédric

1 Answers
DominicStaff
answered 11 years ago

Hello Ced ! 
To hide the right sidebar for a single blog post, you can add the following to the Header Code (Dashboard > Customize > Custom Code)

 <style>
.single-post #content {
    margin-right: 0;
}
.single-post #secondary {
    display: none;
}
</style>

Notice: If you want to remove the following code from single.php: 

 <div id=”secondary”>
<div class=”secondary-inner”>
<?php get_sidebar(); ?>
</div>
</div>

The after removing the line code, you can add the following code to the Header Code: 

 <style>
.single-post #content {
    margin-right: 0;
}
</style>

Hope this helps !  

Ced Newsresources
replied 11 years ago

It helps well ! Thanks a lot

Powered by DW Question & Answer Pro