onajide
Member
Posted 3 years ago #
I've looked at several sources, read many things but, come away still confused. I have a site I'm trying to modify. I want to create a series of pages within the site that will not have a sidebar and, I'm stumped as to how best to go about it.
I understand I can use an "exclude" but, since my theme doesn't have a pages.php, don't I also have to create one in order for the layout to have something to render with or to?
http://www.oceanviewrickshaw.com/pedicabs
Thank you in advance
well if you still have your index.php or any available template files inside your theme directory. You can try the following tricks.
find all
<?php get_sidebar(); ?>
replace with
<?php if (is_page() == false) get_sidebar(); ?>
Extra css, the below code will make the right content fill up the sidebar space.
add it inside functions.php
function custom_page_css()
{ global $wp_query;
if ($wp_query->is_page){
?>
<style type="text/css">
/*<![CDATA[*/
#content{width:858px}
/*]]>*/
</style>
<?php
}
}
add_action('wp_head','custom_page_css');
onajide
Member
Posted 3 years ago #
Thanks. So, I create pages.php by copying index.php and insert the above code? Or, only replace the code on index.php?
for clarification: I DO want the sidebar to show where it currently is showing. I want to create a new set of pages where the sidebar will not show.
u could mod the index.php the code will disabled/exclude the sidebar on "page" sections only.