Help on Aligning Mini-Sadebar to the Left...

Discussion in 'Programming' started by nhatle84, Nov 4, 2009.

  1. #1
    Hi guys,

    I'm currently using a theme which is running on WordPress Platform.

    ScreenShot:

    [​IMG]


    Would someone please assist me on moving the far right sidebar ALL THE WAY TO THE LEFT.... which php files should I be editing?

    Before this, I tried editing all php files but none seems to work, not even index.php, page.php nor stylecss.php does the trick. :rolleyes:

    How you go about achieving the format above? Any advice? Which page editing would accomplish this?

    THEME.php

    <?php
    
    add_filter('comments_template', 'legacy_comments');
    function legacy_comments($file) {
    	if(!function_exists('wp_list_comments')) : // WP 2.7-only check
    		$file = TEMPLATEPATH . '/comments-old.php';
    	endif;
    	return $file;
    }
    
    
    
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'name' => 'Sidebar 1',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '<h2>',
            'after_title' => '</h2>',
        ));
    
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'name' => 'Sidebar 2',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '<h2>',
            'after_title' => '</h2>',
        ));
    
    
    
    function get_wp_vers() {
    	$wp_version = file_get_contents(ABSPATH."wp-includes/version.php");
    	preg_match("/'(.*)'/is", $wp_version, $out);
    	$out = $out[1];
    	preg_match("/\d\.\d/i", $out, $match);
    	return $match[0];
    }
    
    
    
    /* Number of posts */
    if (get_wp_vers() < '2.3') $ptype = '';
    	else $ptype = " AND post_type = 'post'";
    
    $numposts = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->posts." WHERE post_status = 'publish'".$ptype);
    if (0 < $numposts) $numposts = number_format($numposts);
    $numposts = preg_replace("','", '', $numposts);
    
    /* Number of Authors */
    $users = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->users);
    if (0 < $users) $users = number_format($users);
    $users = preg_replace("','", '', $users);
    
    
    
    ?>
    PHP:

    SIDEBAR.php
        </div><!-- end #content -->
        
        <div id="sidebars">
          <div id="l-sidebar">
    
    <?php if (!current_user_can('level_0')) { ?>
    	      <form name="loginform" id="autoriz" action="<?php echo get_settings('siteurl'); ?>/wp-login.php" method="post">
    	        <h2>Authorization</h2>
    	        <label for="login">Login:</label>
    	        <input type="text" name="log" value="" id="login" /><br />
    	        <label for="password">Password:</label>
    	        <input type="password" name="pwd" value="" id="password" />
    	        <input type="submit" name="submit" value="Login" id="enter" />
    	        <div class="rememberme"><label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" value="forever" />Remember me</label></div>
    	        <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
    	        <p><?php wp_register('', ''); ?><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword">Lost your password?</a></p>
    	      </form>
    <?php } else { ?>
    	      <div id="manage">
    	        <h2>Management</h2>
    	        <ul>
                <li><a href="<?php bloginfo('url'); ?>/wp-admin/post-new.php">Submit Article</a></li>
    <?php if (current_user_can('level_7')) { ?>
                <li><a href="<?php bloginfo('url'); ?>/wp-admin/edit.php">Manage</a></li>
                <li><a href="<?php bloginfo('url'); ?>/wp-admin/edit-comments.php">Comments</a></li>
                <li><a href="<?php bloginfo('url'); ?>/wp-admin/plugins.php">Plugins</a></li>
                <li><a href="<?php bloginfo('url'); ?>/wp-admin/users.php">Users</a></li>
                <li><a href="<?php bloginfo('url'); ?>/wp-admin/options-general.php">Options</a></li>
    <?php } ?>
    <?php if (!current_user_can('level_7')) { ?>
                <li><a href="<?php bloginfo('url'); ?>/wp-admin/profile.php">My Profile</a></li>
    <?php } ?>
    <?php if(!function_exists('wp_list_comments')) { ?>
    	          <li><a href="<?php echo get_settings('siteurl') . '/wp-login.php?action=logout&amp;redirect_to=' . $_SERVER['REQUEST_URI']; ?>">Logout</a></li>
    <?php } else { ?>
    	          <li><a href="<?php echo wp_logout_url($_SERVER['REQUEST_URI']); ?>">Logout</a></li>
    <?php } ?>
    	        </ul>
    	      </div>
    <?php } ?>
    
    <?php	if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 1') ) : ?>
    	      <h2>Recent Articles</h2>
    				<?php
    					$myposts = get_posts('numberposts=5');
    					foreach($myposts as $post) : setup_postdata($post);
    				?>
    				<div class="post">
    					<h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    					<div class="postmetadata"><?php the_time('m.d.y') ?> @ <?php the_category(', ') ?></div>
    					<div class="entry">
    					  <?php the_excerpt(); ?>
    					</div>
    				</div>
    				<?php endforeach; ?>
    <?php endif; ?>
    
    			</div><!-- end #l-sidebar -->
    
    
    
    
    
    			<div id="r-sidebar">
    
    <?php	if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 2') ) : ?>
    				<h2>RSS</h2>
    				<ul>
    					<li><a href="<?php bloginfo('rss2_url'); ?>">RSS Articles</a></li>
    					<li><a href="<?php bloginfo('comments_rss2_url'); ?>">RSS Comments</a></li>
    				</ul>
    
    				<h2>Archive</h2>
    				<ul>
    					<?php wp_get_archives('type=monthly'); ?>
    				</ul>
    
    				<h2>Blogroll</h2>
    				<ul>
    					<?php wp_list_bookmarks('categorize=0&title_li='); ?>
    				</ul>
    <?php endif; ?>
    
    			</div><!-- end #r-sidebar -->
    		</div><!-- end #sidebars -->
    PHP:


    STYLE.css
    
    * { margin: 0; padding: 0; }
    html { filter: expression(document.execCommand("BackgroundImageCache", false, true)); }
    body { 
    	font: 13px/18px "Trebuchet MS", Tahoma, Arial, sans-serif;
    	color: #444;
    }
    
    a {
    	color: #9E7302;
    	text-decoration: none;
    }
    a:hover {
    	color: #F0A000;
    	text-decoration: underline;
    }
    p {margin: 0; padding: 10px 0;}
    h1 {margin: 20px 0 0;}
    img {border: 0px;}
    h2 {
    	font: normal 16px "Trebuchet MS", Arial, Sans-Serif;
    	margin: 0 0 12px;
    }
    blockquote {
    	margin: 10px 0 10px 30px;
    	border-left: 3px solid #9E7302;
    	background: #fff4d8;
    	padding: 5px 15px;
    }
    * html blockquote {height: 1%;}
    blockquote p {
    	margin: 0;
    }
    
    #wrapper {
    	width: 990px;
    	margin: 0 auto;
    	border-top: 5px solid #fff4d8;
    }
    
    
    /* Header
    -----------------------------------------------------------------------------*/
    #header {
    	height: 137px;
    	border-bottom: 3px solid #fff4d8;
    	margin-bottom: 28px;
    	position: relative;
    }
    #top-nav {
    	position: absolute;
    	top: 20px;
    	right: 0;
    	list-style: none;
    }
    #top-nav li {
    	float: left;
    }
    #top-nav a {
    	color: #808080;
    	margin: 0 0 0 13px;
    	background: url(i/toparrow.gif) 0 6px no-repeat;
    	padding: 0 0 0 12px;
    	font-size: 12px;
    }
    #top-nav .current_page_item a {
    	background-image: url(i/toparrow2.gif);
    }
    #searchform {
    	position: absolute;
    	padding: 0 3px 0 0px;
    	top: 57px;
    	right: 0;
    }
    #searchform input,
    #search input {
    	font: 11px "Trebuchet MS", Arial, Sans-Serif;
    	float: left;
    }
    #s, .search {
    	width: 175px;
    	padding: 2px 6px;
    	border: 2px solid #ccc;
    	margin-right: 5px;
    }
    #searchsubmit, .go {
    	background: #9E7302;
    	border: 0;
    	padding: 2px 7px;
    	color: #fff;
    	font-weight: bold !important;
    	overflow: visible;
    	height: 24px;
    	cursor: pointer;
    }
    
    #logo {
    	position: absolute;
    	top: 11px;
    	color: #808080;
    	line-height: 1;
    	font-size: 33px;
    }
    #logo span {
    	display: block;
    	font-size: 13px;
    	font-weight: normal;
    	text-transform: uppercase;
    	margin: 5px 0 0;
    }
    
    #nav {
    	position: absolute;
    	top: 105px;
    	left: 0;
    	width: 100%;
    	height: 24px;
    	padding: 7px 0 0 0;
    	clear: both;
    	background: url(i/smalldot.gif) repeat-x;
    	border-bottom: 1px solid #CCC;
    	position: relative;
    }
    #nav li {
    	font-size: 13px;
    	display: inline;
    	text-transform: uppercase;
    }
    #nav li a {
    	margin: 0 25px 0 10px;
    	color: #808080;
    }
    #nav li a:hover {color: #444;}
    #nav li.current_page_item {
    	background: url(i/arrow.gif) no-repeat center left;
    }
    
    
    /* Content
    -----------------------------------------------------------------------------*/
    #container {
    	width: 100%;
    	background: url(i/dots.gif) 550px 0 repeat-y;
    	margin-bottom: 10px;
    }
    * html #container {height: 1%;}
    #container:after {
    	content: '.';
    	display: block;
    	clear: both;
    	visibility: hidden;
    	height: 0;
    }
    #content {
    	width: 540px;
    	float: left;
    	padding: 0 10px 20px 0;
    	overflow: hidden;
    }
    
    #content h2 {
    	font: normal 19px "Trebuchet MS", Arial, Sans-Serif;
    	padding: 1px 0 4px;
    	border-bottom: 1px solid #fff4d8;
    	margin-bottom: 12px;
    }
    #content h2.pagetitle {
    	padding-left: 3px;
    }
    #content h3 {
    	font: normal 17px "Trebuchet MS", Arial, Sans-Serif;
    	color: #920808;
    	padding: 1px 0 4px;
    	margin-bottom: 2px;
    }
    
    #content img {
    	float: left;
    	border: 3px solid #fff4d8;
    	padding: 1px;
    	margin: 5px 10px 5px 0;
    }
    
    #content .post {
    	margin: 0 0 15px;
    }
    #content .post h2,
    #content .post h3 {
    	font-size: 20px;
    	margin: 0 0 2px;
    }
    .post ul,
    .post ol {
    	margin: 7px 0 7px 35px;
    }
    .post li {
    	padding: 2px 0;
    }
    .post .postmetadata {
    	font-size: 11px;
    	padding: 0 0 7px;
    }
    
    .entry h1 {
    	font-size: 18px;
    	margin: 15px 0 10px;
    }
    .entry h2 {
    	font-size: 17px !important;
    	font-weight: bold !important;
    	margin: 15px 0 10px !important;
    	padding: 0 !important;
    	border: none !important;
    }
    .entry h3 {
    	color: #920808;
    	font-size: 15px !important;
    	font-weight: bold !important;
    	margin: 15px 0 10px !important;
    	padding: 0 !important;
    }
    .entry h4 {
    	font-size: 13px;
    	margin: 15px 0 10px;
    	font-weight: bold !important;
    }
    
    .line {
    	clear: both;
    	padding: 3px;
    	margin: 0 0 15px;
    	background: url(i/smalldot.gif) repeat-x;
    }
    .recent {
    	margin-left: 30px;
    }
    .recent li {
    	padding: 1px 0;
    }
    
    .other {
    	margin: 20px 0;
    	background: url(i/smalldot.gif) repeat-x;
    	padding-top: 10px;
    }
    .other .recent li {
    	list-style: none;
    	border-bottom: 1px solid #fff4d8;
    	padding: 4px;
    }
    .other .recent li a {
    	background: #fff url(i/arrow.gif) no-repeat center left;
    	padding: 0 0 0 12px;
    	color: #9E7302;
    }
    
    .nav {
    	padding: 0 0 22px;
    }
    .navigation {
    	margin: 20px 0;
    }
    
    #order {
    	text-align: right;
    	padding: 0 0 10px;
    }
    #order select {
    	font: 13px "Trebuchet MS", Arial, Sans-Serif;
    	width: 120px;
    }
    
    #content ul.child-categories {
    	margin: 0 0 23px 30px;
    }
    #content ul.child-categories ul {
    	margin-left: 20px;
    }
    
    h3#comments {
    	margin-bottom: -10px;
    }
    #respond h3 {
    	margin: 20px 0 0;
    }
    
    ol.commentlist {list-style: none; margin: 20px 0 0; padding:0;}
    ol.commentlist li {border: 1px solid #DFDFDF; height: 1%; margin: 0 0 10px; padding: 5px 10px 8px; position: relative;}
    ol.commentlist li ul.children li {margin: 0 0 2px;}
    ol.commentlist li.comment-author-admin {border-color: #999;}
    ol.commentlist li div.vcard cite.fn {font-style: normal; font-weight: bold;}
    ol.commentlist li div.vcard img.avatar {border: 1px solid #DDD !important; padding: 2px !important; position: absolute; right: 8px; top: 8px; margin: 0 !important;}
    ol.commentlist li div.comment-meta {font-size: 10px; font-weight: bold; color: #888;}
    ol.commentlist li div.comment-meta a {color: #888; text-decoration: none;}
    ol.commentlist li div.comment-meta a:hover {text-decoration: underline;}
    ol.commentlist li div.reply {font-size: 13px; line-height: 16px; width: 100%; overflow: hidden; text-transform: lowercase; }
    ol.commentlist li div.reply a {background: #F4F4F4; float: left; color: #AA0001; text-decoration: none; padding: 0 6px 2px; border: 1px solid #CCC;}
    ol.commentlist li div.reply a:hover {background: #9E7302; color: #FFF; border: 1px solid #9E7302;}
    ol.commentlist li ul.children {list-style: none; margin: 10px 0 0;}
    #cancel-comment-reply small {font-size: 13px}
    ol.commentlist li.even {background: #FFF;}
    ol.commentlist li.odd {background: #F4F4F4;}
    
    #commentform p {
    	padding: 8px 0 3px;
    }
    #author, #email, #url, #comment, #submit {
    	font: 13px Arial, Tahoma;
    	padding: 3px 5px;
    	width: 200px;
    	border: 1px solid #CCC;
    }
    #comment {
    	width: 528px;
    	height: 170px;
    }
    #author:focus, #email:focus, #url:focus, #comment:focus, #submit:focus {
    	border-color: #999;
    }
    li.depth-1 #comment {width: 505px}
    li.depth-2 #comment {width: 485px}
    li.depth-3 #comment {width: 462px}
    li.depth-4 #comment {width: 442px}
    li.depth-5 #comment {width: 425px}
    #submit {
    	width: 115px;
    	height: 24px;
    	padding: 0;
    	background: #F4F4F4;
    	cursor: pointer;
    	overflow: visible;
    }
    #submit:hover {
    	background: #9E7302;
    	color: #FFF;
    	border: 1px solid #9E7302;
    }
    
    
    
    /* Sidebars
    -----------------------------------------------------------------------------*/
    #sidebars {
    	float: left;
    	width: 440px;
    	font-size: 12px;
    	line-height: 17px;
    }
    * html #sidebars {height: 1%;}
    #sidebars:after {
    	content: '.';
    	display: block;
    	clear: both;
    	visibility: hidden;
    	height: 0;
    }
    
    #l-sidebar {
    	float: left;
    	width: 230px;
    	padding: 0 10px;
    }
    #r-sidebar {
    	float: left;
    	width: 180px;
    	padding: 0 0 0 10px;
    }
    
    #sidebars ul {
    	margin: 0 0 15px;
    }
    #sidebars li {
    	list-style: none;
    	border-bottom: 1px solid #fff4d8;
    	padding: 3px 4px;
    	margin: 0;
    }
    #sidebars li a {
    	background: url(i/arrow.gif) no-repeat center left;
    	padding: 0 0 0 12px;
    	color: #808080;
    }
    #sidebars h2 {
    	font: normal 20px "Trebuchet MS", Arial, Sans-Serif;
    	color: #920808;
    	padding: 0 0 3px 3px;
    	border-bottom: 1px solid #fff4d8;
    }
    #sidebars h3 {
    	font: normal 17px/19px "Trebuchet MS", Arial, Sans-Serif;
    	padding: 0 0 3px;
    }
    #sidebars .post {
    	margin: 0 0 24px;
    }
    #sidebars p {
    	padding: 0;
    }
    #sidebars .postmetadata {
    	font-size: 11px;
    }
    
    #autoriz {
    	margin: 0 0 20px;
    }
    #autoriz label {
    	display: block;
    	float: left;
    	width: 58px;
    	padding: 0 12px;
    	font-size: 13px;
    }
    #autoriz input {
    	float: left;
    	font: 13px "Trebuchet MS", Arial, Sans-Serif;
    	width: 130px;
    	margin-bottom: 5px;
    	border: 1px solid #CCC;
    	padding: 0 2px;
    }
    .rememberme {
    	padding: 0 0 0 12px;
    }
    #autoriz .rememberme label {
    	cursor: pointer;
    	padding: 0;
    	width: 120px;
    	margin: 2px 0 0;
    	*margin: 3px 0 0;
    }
    #autoriz .rememberme input {
    	width: 15px;
    	padding: 0;
    	border: none;
    	margin: 2px 4px 0 0;
    	*margin: -1px 4px 0 0 !important;
    	*margin: -1px 2px 0 0;
    }
    #autoriz #enter {
    	float: right;
    	margin: 0 12px 0 0;
    	border: none;
    	background: #9E7302;
    	color: #FFF;
    	width: 60px;
    	height: 21px;
    	cursor: pointer;
    }
    #autoriz p {
    	clear: both;
    	text-align: center;
    	padding: 5px 0 0;
    }
    #autoriz a {
    	margin: 0 7px;
    }
    
    #manage {
    	margin: 0 0 20px;
    }
    #manage p {
    	padding: 0 0 10px 5px;
    	font-size: 13px;
    	font-weight: bold;
    }
    
    
    /* Footer
    -----------------------------------------------------------------------------*/
    #footer {
    	clear: both;
    	padding: 7px 10px;
    	margin: 0 0 15px;
    	font-size: 11px;
    	line-height: 16px;
    	color: #808080;
    	background: #e3fd5g;
    }
    PHP:

    All advice is highly appreciated,
    -Minh
     
    Last edited: Nov 4, 2009
    nhatle84, Nov 4, 2009 IP