• Resolved Eric Rosenberg

    (@eric1985)


    I have a new template installed at beta.israelsituation.com. I am trying to edit it so there is a top sidebar that is double width and two narrower ones below. As of now, there are two narrow sidebars the length of the page.

    How can I edit the template to bring in one wide sidebar above two narrow ones? Optimally I will have three sidebars in the widget dashboard so I can edit them easily.

Viewing 3 replies - 1 through 3 (of 3 total)
  • In sidebar.php create a DIV above the two narrow sidebar DIV’s. Give it an ID and create CSS for that div ID in the style sheet that has the width you want.

    If the other sidebar columns are defined with a DIV class you can use the same class for the new one, which allows the new wide sidebar to inherit all the styling the other two sidebars are using. Give it an ID and in style.css override the default width by assigning a wider width to the new sidebar DIV ID.

    1. I suggest that you decrease width of any image or video embed you have in content to 500px only. The 530px width you currently have for your video is too wide that the content block causes the right sidebar to drop down in IE.

    2. Create a template file named sidebar_top.php

    3. Open it and add this code to make it a widget:

    <div id="sidebar_top">
    	<ul>
    	<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
    		<li>
    		<h2>About Us</h2>
    		<p>Some text about you. Any widget you place here in admin will be overwritten anyway.</p>
    		</li>
    	<?php endif; ?>
    	</ul>
    </div><!-- end sidebar_top -->

    4. Open up your theme’s function.php and change 2 below to 3

    <?php
    if ( function_exists('register_sidebars') )
        register_sidebars(2);
    ?>

    5. You would have to revise following template files
    404.php, archive.php, index.php, page.php, single.php and tag.php
    to add this
    <?php include(TEMPLATEPATH."/sidebar_top.php");?>
    right above the followng:

    <?php include(TEMPLATEPATH."/l_sidebar.php");?>
    <?php include(TEMPLATEPATH."/r_sidebar.php");?>

    6. Open up your theme’s style.css and add this:
    #sidebar_top { float right: clear: right; width 320px; }

    7. Save sidebar_top.php in theme folder and all revised style.css and other template files in your theme folder and FTP upload to server.

    Naeem

    (@mnaeemsattar)

    Hi, can you post same functioning code for WordPress 2.9.x???
    Because as you earlier mentioned in point 5. to include the line right above the given 2 lines, these given 2 lines are not available in my theme in WordPress 2.9.x in any of above mentioned files: 404.php, archive.php, index.php, page.php, single.php and tag.php

    Can anyone help to add top wide widget in my theme at : https://buy92.com/faqr

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Editing Sidebar Layout’ is closed to new replies.