Помогите. Запутался в коде..
Хотел переделать CSS шаблон в WP тему для своего сайта.
За основу взял CSS шаблон _www.freecsstemplates.org/preview/perfectblemish/_ и тему вордпресс BWDEC _wordpresse.ru/themes/899/_
Как это выглядит: _demoweb.comyr.com_ (НЕ РЕКЛАМА, просто сайт для тестирования шаблона)
Главная стр. меня устраивает
не устраивает пропасть между блоком контент и сайдбаром (в странице/в стр. поста/ и т.д.)
Вот коды(помогите пож. исправить):
index.php<?php get_header(); ?>
<?php include (TEMPLATEPATH . '/articles.php'); ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
header.php<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php if (function_exists('seo_title_tag')) { seo_title_tag(); }
else { bloginfo('name'); wp_title();} ?> </title>
<?php wp_get_archives('type=monthly&format=link'); ?>
<?php //comments_popup_script(); // off by default ?>
<?php wp_head(); ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
<div id="header-wrapper">
<div id="header">
<div id="logo">
</div>
<div id="header-banner">
<!--AdvLine START-->
<!--advline.ru-->
<!--Площадка: FxTrade.kz / 728x90 - FxTrade.kz / 728x90-->
<!--Категория: Форекс-->
<!--Тип баннера: 728x90-->
<script type="text/javascript">
<!--
if (typeof(pr) == 'undefined') { var pr = Math.floor(Math.random() * 1000000); }
var addate = new Date();
document.write('<iframe src="http://ads.advline.ru/42477/getCode?p1=cebs&p2=tht&p3=b&p4=a&pct=a&pfc=a&pfb=a&pr=' + pr + '&pt=b&pd=' + addate.getDate() + '&pw=' + addate.getDay() + '&pv=' + addate.getHours() + '&" frameBorder="0" width="728" height="90" marginWidth="0" marginHeight="0" scrolling="no" style="border: 0px; margin: 0px; padding: 0px;"><a href="http://ads.advline.ru/42477/goDefaultLink?p1=cebs&p2=tht" target="_blank"><img src="http://ads.advline.ru/42477/getDefaultImage?p1=cebs&p2=tht" border="0" alt=""><\/a><\/iframe>');
//-->
</script>
<noscript>
<iframe src="http://ads.advline.ru/42477/getCode?p1=cebs&p2=tht&p3=b&p4=a&pct=a&pfc=a&pfb=a&" frameBorder="0" width="728" height="90" marginWidth="0" marginHeight="0" scrolling="no" style="border: 0px; margin: 0px; padding: 0px;"><a href="http://ads.advline.ru/42477/goDefaultLink?p1=cebs&p2=tht" target="_blank"><img src="http://ads.advline.ru/42477/getDefaultImage?p1=cebs&p2=tht" border="0" alt=""></a></iframe>
</noscript>
<!--AdvLine END-->
</div>
</div>
</div>
articles.php<div id="page">
<div id="content">
<div class="post">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2><br/>
<div class="entry">
<?php the_content('Read more »'); ?>
<?php comments_template(); ?>
<?php endwhile; ?>
<?php else : ?>
<h2 align="center">Not Found</h2>
<p align="center">Unfortunately, your search returned no results. </p>
<?php endif; ?>
<p align="center"><?php next_posts_link('« Before') ?> <?php previous_posts_link('Later »') ?></p>
</div>
</div>
</div>
</div>
comments.php<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>
<p class="nocomments">Please enter your password to view comments.</p>
<?php
return;
}
}
/* This variable is for alternating comment background */
$oddcomment = 'class="alt" ';
?>
<!-- You can start editing here. -->
<?php if ($comments) : ?>
<h3 id="comments"><?php comments_number('No reviews', 'One Response', 'Reviews: %' );?> на «<?php the_title(); ?>»</h3>
<ol class="commentlist">
<?php foreach ($comments as $comment) : ?>
<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
<cite><?php comment_author_link() ?></cite> wrote:
<?php if ($comment->comment_approved == '0') : ?>
<em>Thank you! Your comment is awaiting moderation.</em>
<?php endif; ?>
<br />
<small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('d M Y') ?> в <?php comment_time() ?></a> <?php edit_comment_link('править',' ',''); ?></small>
<?php comment_text() ?>
</li>
<?php
/* Changes every other comment to a different class */
$oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
?>
<?php endforeach; /* end for each comment */ ?>
</ol>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments"></p>
<?php endif; ?>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>
<h3 id="respond">Ваш отзыв</h3>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>Вы должны <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">войти</a>, чтобы оставлять комментарии.</p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p>Вы вошли как <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Выйти из этого аккаунта">Выйти »</a></p>
<?php else : ?>
<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small>Имя <?php if ($req) echo "*"; ?></small></label></p>
<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small>Почта (скрыта) <?php if ($req) echo "*"; ?></small></label></p>
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small>Сайт</small></label></p>
<?php endif; ?>
<!--<p><small><strong>XHTML:</strong> Вы можете использовать следующие теги: <code><?php echo allowed_tags(); ?></code></small></p>-->
<p><textarea name="comment" id="comment" cols="50%" rows="10" tabindex="4"></textarea>
</p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="Добавить" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>
sidebar.php<div id="sidebar">
<ul>
<li>
<img src="http://demoweb.comyr.com/wp-content/uploads/2010/12/banner300x200.png" border=0>
</li>
<li>
<h2>Котировки</h2>
<iframe frameborder="0" scrolling="no" height="275" width="300" allowtransparency="true" marginwidth="0" marginheight="0" src="http://tools.forexpros.ru/market_quotes.php?tab_1=1,2,3,5,7,9&tab_2=169,166,20,172,27,178&tab_3=8830,8849,8836,8862,8831,8988&tab_4=8880,8907,8900,8899,8886,8895&select_color=000000&default_color=0059B0"></iframe>
</li>
<li>
<h2>Навигация</h2>
<ul>
<?php wp_list_cats(); ?>
</ul>
<h2>Статьи</h2>
<ul>
<?php wp_get_archives('type=postbypost&limit=4'); ?>
</ul>
</li>
<li>
<?php if ( function_exists('wp_tag_cloud') ) : ?>
<p><?php wp_tag_cloud('smallest=8&largest=18'); ?></p>
<?php endif; ?>
</li>
</ul>
</div>
news.php<ul>
<?php wp_get_archives('type=postbypost&limit=4'); ?>
</ul>
footer.php<div style="clear: both;"> </div>
</div>
<!-- end #page -->
</div>
<div id="footer">
<p>© Copyright 2009-2010.<br />
</p>
</div>
<!-- end #footer -->
</body>
</html>
style.css/*
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
*/
body {
margin: 20px 0px 0px 0px;
padding: 0;
background: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #3C3D3F;
}
h1, h2, h3 {
margin: 0;
padding: 0;
font-weight: normal;
color: #FF3000;
}
h1 {
font-size: 2em;
}
h2 {
font-size: 2.8em;
}
h3 {
font-size: 1.6em;
}
p, ul, ol {
margin-top: 0;
line-height: 180%;
}
ul, ol {
}
a {
text-decoration: underline;
color: #EB1D1D;
}
a:hover {
text-decoration: none;
}
#wrapper {
margin: 0 auto;
padding: 0;
}
/* Header */
#header {
overflow: hidden;
width: 1000px;
height: 92px;
margin: 0px auto 20px auto;
}
/* Logo */
#logo {
float: left;
width: 270px;
margin: 0;
padding: 0;
color: #000000;
}
/* Header banner 728x90 */
#header-banner {
float: right;
width: 730px;
}
/* Page */
#page {
width: 1000px;
margin: 0 auto;
padding: 40px 0px 0px 0px;
border-top: 1px solid #BBBBBB;
}
#page-bgtop {
}
/* Content */
#content {
float: left;
width: 680px;
padding: 0px 0px 0px 0px;
background: #FFFFFF;
}
.post {
margin-bottom: 30px;
padding: 0px 0px;
}
.post .title {
height: 20px;
padding: 0px 0px 0px 0px;
}
.post .title a {
letter-spacing: -2px;
text-decoration: none;
text-transform: lowercase;
color: #414141;
border: none;
}
.post .entry {
padding: 10px 0px 20px 0px;
padding-bottom: 20px;
border-bottom: 1px solid #BBBBBB;
text-align: justify;
}
.post .meta {
overflow: hidden;
padding-top: 10px;
}
/* Sidebar */
#sidebar {
float: right;
width: 300px;
margin: 0px;
padding: 0px 0px 0px 0px;
}
#sidebar ul {
margin: 0;
padding: 0;
list-style: none;
}
#sidebar li {
margin: 0px 0px 0px 20px;
padding: 0;
}
#sidebar li ul {
margin: 0px;
padding-bottom: 30px;
}
#sidebar li li {
line-height: 35px;
border-bottom: 1px solid #BBBBBB;
border-left: none;
text-align: left;
}
#sidebar li li span {
display: block;
margin-top: -20px;
padding: 0;
font-size: 11px;
font-style: italic;
}
#sidebar li li a {
padding: 0px 0px 0px 20px;
}
#sidebar h2 {
height: 30px;
margin: 0px 0px 20px 0px;
padding: 4px 0px 0px 20px;
text-align: left;
text-transform: capitalize;
letter-spacing: -2px;
font-size: 2em;
color: #414141;
}
#sidebar p {
margin: 0 0px;
padding: 0px 20px 20px 20px;
text-align: justify;
}
#sidebar a {
border: none;
text-decoration: none;
}
#sidebar a:hover {
text-decoration: underline;
}
/* Footer */
#footer {
width: 1000px;
height: 50px;
margin: 0 auto;
padding: 0px 0 15px 0;
border-top: 1px solid #BBBBBB;
font-family: Arial, Helvetica, sans-serif;
}
#footer p {
margin: 0;
padding: 20px 0px 0px 30px;
line-height: normal;
font-size: 10px;
text-transform: uppercase;
text-align: center;
color: #45302C;
}
#footer a {
color: #6B4A45;
}