Support » Fixing WordPress » Right sidebar space

  • Resolved gite_kaus



    I’ve made a new custom page where sidebar doesn’t appear anymore, but the space is blocked still and i can’t put neither text or images. Here is how it looks like
    Please help as i’ve tried few things and nothing is working.

    Here is my new page with no sidebar code:

    Template Name: page-nosidebar
    <?php get_header(); ?>
    <div id="content" >
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <div class="title">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <div class="entry">
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    <div class="clear"></div>
    <?php endwhile; else: ?>
    		<h1 class="title">Not Found</h1>
    		<p>I'm Sorry,  you are looking for something that is not here. Try a different search.</p>
    <?php endif; ?>
    <?php get_footer(); ?>

    Thank you very much for your time and help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • unfortunately, your currently used theme does not use body_class() which would output a page template specific CSS class on which you could base the formatting.

    you could consider to edit header.php and add some specific CSS class to one of the wrapper divs, using a conditional statement with is_page_template()

    as your theme is not from, you might need to contact the developer of your theme directly for support with details.

    Thank you so much! What a shame! I’ll try to look in to your suggestion about the header.

    Hello again,

    I’ve tried to do it, but i think i did some nonsense, as im not advances in wp at all. I placed that code in header.php under wraper, and changed about.php to the name of my page, which has no right sidebar. Please guide me, if its not too complicated and there is a hope for me to succeed. Thank you.

    Here is what i did:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="" <?php language_attributes(); ?>>
    <head profile="">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/listing.css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    wp_enqueue_script('bxslider', get_stylesheet_directory_uri() .'/js/jquery.bxSlider.min.js');
    wp_enqueue_script('superfish', get_stylesheet_directory_uri() .'/js/superfish.js');
    wp_enqueue_script('effects', get_stylesheet_directory_uri() .'/js/effects.js');
    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php //comments_popup_script(); // off by default ?>
    if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
    <div id="masthead">
    <div id="head">
    <div id="top" class="clearfix">
    	<div id="blogname">
    		<h1 id="logo"><img src=""  ?></h1>
    	<div id="contactlist">
    		<div class="rphone">
    		<span>Call us</span><br/>
    		<p><?php $my_phone =get_option('aven_my_phone'); echo $my_phone ?></p>
    		<div class="rmail">
    		<span>Mail us</span><br/>
    		<a href="" target="_blank"></a>
    <div id="botmenu">
    	<?php wp_nav_menu( array( 'container_id' => 'submenu', 'theme_location' => 'primary','menu_class'=>'sfmenu','fallback_cb'=> 'fallbackmenu' ) ); ?>
    </div><!-- END botmenu -->
    </div><!--end masthead-->
    <div id="wrapper">
    if ( is_page_template( 'page-nosidebar.php' ) ) {
    	// Returns true when 'page-nosidebar' is being used.
    } else {
    	// Returns false when 'page-nosidebar' is not being used.
    <div id="casing">

    try to change this section:

    <div id="wrapper">
    if ( is_page_template( 'page-nosidebar.php' ) ) {
    	// Returns true when 'page-nosidebar' is being used.
    } else {
    	// Returns false when 'page-nosidebar' is not being used.


    <div id="wrapper" <?php
    if ( is_page_template( 'page-nosidebar.php' ) ) {
    	echo ' class="full-width"';
            // Returns true when 'page-nosidebar' is being used.
    } ?>>

    Thank you. Still same 🙁 Just to double check i had to do this on a header.php?

    Still same

    the injection of a page tempalte specific CSS class was successful.
    now, you need to apply CSS based on this new CSS class.


    .full-width #content { width: 960px; }

    ideally add this CSS via a custom CSS plugin or via a child theme.

    I activated Simple Custom CSS plugin and added:
    .full-width #content { width: 960px; }
    Did i follow your directions correctly or its not as simple as that? Im not sure if it’s working?

    Many thanks.

    you seem to have added the new style within CSS commenting code;

    this is what I see in your custom style:
    /* .full-width #content { width: 960px; } */

    this is how it should be:
    .full-width #content { width: 960px; }

    Silly mistake!
    You are a hero!!!!!!! 🙂 Thank you very very much! It works!!! :)))


Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Right sidebar space’ is closed to new replies.