• Resolved supermomwannabe

    (@supermomwannabe)


    I found a code for removing the sidebar from one specific page, but what is the code for removing the sidebar from multiple pages, for the page template? I’d rather do that than find a plug in.

Viewing 9 replies - 16 through 24 (of 24 total)
  • Ok thanks, and I just add that to the page.php in place of what I had correct?

    Yes

    It worked this time. I was using the wrong number to identify the page number.

    THANK YOU!!

    Put his code:

    <?php if( !is_page( array( 124, 379, 6 ) ) ) get_sidebar()){?>
    <?php get_sidebar(); ?>
    <?php } ?>

    Didnt work, it 500’d all my pages

    I also added JUST this:

    <?php if( !is_page( array( 124, 379, 111 ) ) ) get_sidebar());?>

    Same result, 500 all ages.

    Ok, so I created a custom page template named nosidebar.php.
    I can choose it from the drop down when I add a page and it does not have a side bar.

    BUT, as I have read I still have the space bloacked out for the side bar. I copied the page.php code removed the sidebar code.

    Now, the page.php script is :
    <?php
    /*
    Template Name: nosidebar
    */
    ?>
    <?php get_header(); ?>
    <div class=”span-16″>
    <div id=”content”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2 class=”title”><?php the_title(); ?></h2>
    <div class=”entry”>
    <?php if ( function_exists(“has_post_thumbnail”) && has_post_thumbnail() ) { the_post_thumbnail(array(300,225), array(“class” => “alignleft post_thumbnail”)); } ?>
    <?php the_content(‘<p class=”serif”>Read the rest of this page »</p>’); ?>

    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>

    </div>
    </div>
    <?php endwhile; endif; ?>
    <?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>
    </div>
    </div>

    </div>
    <?php get_footer(); ?>

    What do I do to call a css style that will give me control over this page container? It doesnt call container, even if I add a different content value it doesnt seem to work.

    I got it, it was a template that called a span style, once I found the source css i could determine the proper width.

    Solved, learned a few things along the way also.

    ;)~

    Ok… I’ve been trying this code but the area that is the sidebar still is blocked out and the image in the main posting area is cut off. I want the sidebar completely removed and the posting area to take up that space so my image will show properly.

    Here is a link to the page where I am having issues.

    https://www.golivetoday.com/wp/?page_id=126

    Is there somewhere to designate how large the posting area is on one page? Or am I looking in the wrong direction?

    I read the all comments. but i cant remove the side bar from my home page. anybody can help me??

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘How to remove sidebar from multiple pages’ is closed to new replies.