Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Adding Second Column on Main Page

  1. #1
    Thread Starter
    Rookie
    Not a Verified Customer
    jason's Avatar
    Join Date
    Mar 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding Second Column on Main Page

    I have been tinkering around with the code all evening, trying to figure out how to add a second column on the main page. I want to use the second column to display local banner ads that I plan on selling here in my city to local businesses

    I've attached a graphic rendering ( i made it in photoshop) of what I am trying to accomplish to better explain.

    If anyone has any information on how to add the additional column that would be extremely helpful.


  2. #2
    Member
    Not a Verified Customer
    secretstache's Avatar
    Join Date
    Mar 2009
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Second Column on Main Page

    I'll have a look, as this is something I planned on building as well. It should not be too difficult.

  3. #3
    Member
    Not a Verified Customer
    secretstache's Avatar
    Join Date
    Mar 2009
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Second Column on Main Page

    Jason.

    Okay so I worked this out last night, and for the most part it is just a matter of playing with the css. I'm going to assume that you have at least a working knowledge and understanding of css layout techniques, since you mentioned you tinkered around with the theme files. Open open up style.css from the classipress theme folder and make these modifications. Note, that these do no replace the current css declarations, but are just modifying certain attributes (for the most part just the width attribute).

    .header {width: 1024px;}
    .topbar {width: 1024px;}
    .content {width:1024px;}
    .main {width: 750px ; float: left;}

    open header.php and navigate to lines 48 and 53 and change the width attribute to 150px (I'm not sure why there are inline styles here, but there must be a reason for it:
    .listing .head .name {width: 150px;}
    .name {width: 150px;}

    Ok this sets up room for the ads, now we need to add the banners to the layout, so open index.html. At around line 96 there is a closing tag for the "main" class div. It may be a bit tricky for you to find since the html has not been commented, but for me that div ends on line 96 and it should be the same for you. Go ahead and comment that line so that you know where you are looking in the future like this <--end main--> Right below that add this html:

    Code:
    <div class="secondary">
    	<div id="adContainer">
    		<div class="ads">
    			
    
    Ad Placeholder</p>
    		</div>
    		<div class="ads">
    			
    
    Ad Placeholder</p>
    		</div>
    		<div class="ads">
    			
    
    Ad Placeholder</p>
    		</div>
    		<div class="ads">
    			
    
    Ad Placeholder</p>
    		</div>
    	</div>
    </div>
    This puts 4 ad divs in you can copy and paste these to add more if you want. Ok now for the css (i only did placeholders for you, so you will have to change this to make it look the way you want. Anyway, here is the css...i inserted this at the end of the css file, though realistically it should be in a more intuitive place in your code...

    Code:
    #adContainer {
    	float: right;
    	width: 200px;
    }
    
    
    .ads {
    	background: gray;
    	display: block;
    	margin: 0 0 10px 0;
    	padding: 0;
    	width: 200px;
    	height: 100px;
    }
    
    .ads p {
    	margin: 0;
    	padding: 0;
    }
    Ok. that sets up ad placeholders and you are all set to add your ad code from openx.org or whatever you plan to use. Let me know if I missed anything, as I built it last night, but was too tired to post.

    Rich

  4. #4
    Member
    Not a Verified Customer
    secretstache's Avatar
    Join Date
    Mar 2009
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Second Column on Main Page

    i forgot to add this bit to the css:

    Code:
    .secondary {float: right; width: 220px;}

  5. #5
    Thread Starter
    Rookie
    Not a Verified Customer
    jason's Avatar
    Join Date
    Mar 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Second Column on Main Page

    Rich,

    I know this may sound silly, but is there a program I can use to locate the lines? I am having trouble finding what you mentioned at line 48 and 53. Maybe I'm not looking at the right spot

    Jason

  6. #6
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: Adding Second Column on Main Page

    A great free html editor which I use for developing ClassiPress is called Notepad++. It shows you the line numbers among other things.

  7. #7
    Junior Member
    Not a Verified Customer
    onlinebisnes's Avatar
    Join Date
    Mar 2009
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Second Column on Main Page

    are they possible to have that sidebar column widgetable so we can add/remove widget on that homepage sidebar via widget admin panel?

  8. #8
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: Adding Second Column on Main Page

    Yeah you could. Just look at how single.php or page.php uses the dynamic sidebar widget.

  9. #9
    Rookie
    Not a Verified Customer
    motyla's Avatar
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Second Column on Main Page

    you will have to add changes once again after upgrade anyway...

  10. #10
    Rookie theotheo's Avatar
    Join Date
    Apr 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Second Column on Main Page

    use notepad + ctrl + f to find lines

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)