Forums

Help - Adding another sidebar (8 posts)

  1. daniel000
    Member
    Posted 2 years ago #

    Hi guys

    My site, http://www.aflsource.com

    Now i want to add another sidebar on the left hand side so i have room to add google adds.

    I have found a couple sites that walk you through it, but im having a little trouble because there is always little differences and i then get confused

    Im wondering if anyone would be able to help, if so it would be greatly appreciated

  2. daniel000
    Member
    Posted 2 years ago #

    bump/

  3. alchymyth
    The Sweeper
    Posted 2 years ago #

    “The greatest prayer is patience” - The Buddha

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    honestly, tutorials are going to be different

    the mechanics of adding a sidebar are pretty much the same, but the way people code can be different depending how they learned.

    Also, depends on what theme they are teaching you about

    I learned from this one....
    http://www.blogohblog.com/adding-extra-sidebar-to-your-wordpress-theme/

    but basically you may have to play around a bit....

  5. daniel000
    Member
    Posted 2 years ago #

    sorry alchymth. i waited 10 hours :O lol
    i think it is because of the time difference, im from australia

    Also i was working off that site, i think my issue is with the index.php it should have -

    <?php include (TEMPLATEPATH . '/sidebar.php'); ?>

    but my template ( Stripey ) didnt have this code.

    Also, my site DID have a functions.php page, and had this code that related to

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

    but looked like this.

    <?php
    if ( function_exists('register_sidebar') )
    {
    register_sidebar(array(
    'before_widget' => '<li id="%1$s" class="widget %2$s">',
    'after_widget' => '',
    'before_title' => '<h2 class="widgettitle">',
    'after_title' => '</h2>',
    ));
    }

    With a whole heap of other code, that i couldnt find in any other theme that had 2 columns.

  6. alchymyth
    The Sweeper
    Posted 2 years ago #

    start to edit header.php - at the end: change from this:

    <div id="body">
    <div id="body_top">
    	<div id="body_left">
        	<div id="body_left_content">

    to this:

    <div id="body">
    <div id="body_top">
    <?php include("sidebar2.php") ?>
    	<div id="body_left">
        	<div id="body_left_content">

    (read for instance: http://www.quickonlinetips.com/archives/2007/11/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets/)

    make a copy of 'sidebar.php' and name it 'sidebar2.php', save it in the theme folder (the same folder you got sidebar.php from).

    edit 'sidebar2.php': end up with this code in there, sidebar2 code
    edit 'functions.php': only at the beginning functions code (only the first 16 lines are different - copy them from the link without the line numbers, scroll further down to get the code)

    edit style.css at a few places:
    (assuming and tested with sidebar2 width:190px)

    add these new lines:

    #sidebar2 {
    width:190px;
    float:left;
    margin-left:10px;
    margin-top: 15px;
    }

    find these and edit the numbers:

    #body_left{
    	width:460px; /*was 670px without sidebar2 wide 190px*/
    	float:left;
    #body_left_content{
    	width:415px; /*was 615px without sidebar2 wide 190px*/
    	padding:25px 0 0 30px;
    }
    #respond{
    	margin:40px 15px 0 10px; /*reduced 30px to 10px*/
    	padding-bottom:60px;
    }
    #commentform{
    	margin-left:25px; /*reduced from 55px*/
    	color:#000000;
    	font-size:12px;
    	width:80%;
    	font-family:Arial, Helvetica, sans-serif;
    }

    this should be all, not intensively tested:
    good luck, ;-)

  7. daniel000
    Member
    Posted 2 years ago #

    Hey thank you so much!

    Well i decided to not go with that. I was having wayy to much trouble formatting the whole document

    I decided to go with adding a white strip on the side, so i can put the adds in there

    My problem now is, i have the image but i cant seem to move it at all

    Im using the code

    #advert{

    position:absolute;
    background-color:white;
    width:120px;
    height:600px;
    top:196px;
    left:870px;
    z-index: 9;
    }

    which is in the style sheet

    and then putting the div into the header.php where all the other divs seem to be.

  8. daniel000
    Member
    Posted 2 years ago #

    I fixed the problem

    now i have an issue or question, i want to get my google adds to appear in this white section instead of all over my blog. im using Adsense now!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.