WordPress.org

Support

Support » Themes and Templates » Help with widgetizing theme – functions.php

Help with widgetizing theme – functions.php

  • Hi There,

    I have a problem with widgetizing my theme using the functions.php file.

    My HTML is as follows:

    <div class="rightbar">
        <div class="righttitle">Best of the best</div>
        <br clear="all" />
        <div class="rightcontent">more test test test test test test test lol ionoun uwdjd wurhfn eurfie fieowjfe </div>
    </div>

    The CSS for this is:

    .rightbar {
        text-align: left;
        width: 315px;
        margin: 0 auto;
    	border-left: 1px;
    	float: right;
    	background-color:#FFF;
    	height: auto;
    	min-height: 99%;
    
    }
    
    .righttitle {
        text-align: left;
        width: 307px;
    	height: 35px;
        margin: 0 auto;
    	border-left: 1px;
    	float: left;
    	background-image:url(sidetitle.gif);
    	padding-top: 20px;
    	padding-left: 20px;
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 18px;
    	color:#FFF;
    
    }
    
    .rightcontent {
    	background-color:#d5d4d4;
    	border-left: 1px solid #999;
    	border-bottom: 1px solid #999;
    	margin-left: 10px;
    	padding-left: 5px;
    
    }

    The problem is the title is wider than the content, so when I code the functions.php the main content is stretched to the width of the title.

    I have coded my functions.php in many different ways and ran in to the same problem.

    Any help is really appreciated as this has been annoying me for a good few hours!

Viewing 6 replies - 1 through 6 (of 6 total)
  • I know its not been long but any help would be really appreciated, this has been bothering me for ages!

    Anyone? 🙁

    esmi

    @esmi

    Forum Moderator

    Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of specific help.

    And please don’t bump posts.

    I think ive provided everything there for someone to look?

    The problem is where the different div codes go, before and after title seems to interpret the code a bit weirdly and this stretches everything to its size.

    It is better to provide a demo that shows the problem (or at least the full code of the HTML file)

    I usually use a spacer div to clear the float.

    div class="spacer"

    add these to your stylesheet:

    .spacer {clear:both}

    Correction:

    It’s not div class="spacer"

    The correct one :

    <div class="spacer"></div>
    
    .spacer {clear:both;}
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Help with widgetizing theme – functions.php’ is closed to new replies.