• Resolved gite_kaus

    (@gite_kaus)


    Hello,

    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. https://www.propertypeaks.co.uk/?page_id=710&preview=true
    https://www.propertypeaks.co.uk/landlords/

    Here is my new page with no sidebar code:

    <?php
    /*
    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>
    
    <div class="entry">
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    
    <div class="clear"></div>
    </div>
    
    </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; ?>
    
    </div>
    
    <?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() https://codex.www.ads-software.com/Function_Reference/is_page_template

    as your theme is not from https://www.ads-software.com/themes/, you might need to contact the developer of your theme directly for support with details.

    Thread Starter gite_kaus

    (@gite_kaus)

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

    Thread Starter gite_kaus

    (@gite_kaus)

    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" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <head profile="https://gmpg.org/xfn/11">
    <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'); ?>" />
    
    <?php
    wp_enqueue_script('jquery');
    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 ?>
    
    <?php
    if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
    wp_head();
    ?>
    
    </head>
    
    <body>
    
    <div id="masthead">
    
    <div id="head">
    
    <div id="top" class="clearfix">
    	<div id="blogname">
    		<h1 id="logo"><img src="https://propertypeaks.co.uk/wp/wp-content/uploads/2013/04/Property-Peaks-Web-Logo_new1.png"  ?></h1>
    	</div>
    
    	<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>
    		<div class="rmail">
    		<span>Mail us</span><br/>
    
    		<a href="mailto:[email protected]" target="_blank">[email protected]</a>
    		</div>
    	</div>
    
    </div>
    
    <div id="botmenu">
    	<?php wp_nav_menu( array( 'container_id' => 'submenu', 'theme_location' => 'primary','menu_class'=>'sfmenu','fallback_cb'=> 'fallbackmenu' ) ); ?>
    </div><!-- END botmenu -->
    
    </div>
    
    </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.
    }

    to:

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

    (@gite_kaus)

    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.

    example:

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

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

    Thread Starter gite_kaus

    (@gite_kaus)

    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; }

    Thread Starter gite_kaus

    (@gite_kaus)

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

    Thread Starter gite_kaus

    (@gite_kaus)

    Thanks!

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