Permalink
Browse files

fix: article list for .home-content

  • Loading branch information...
1 parent 7f786b0 commit 6cb7ff65f48d5cea6576d6d9b621950db4bd7a10 @zolunx10 committed Apr 16, 2012
Showing with 92 additions and 42 deletions.
  1. +27 −13 _/css/main.css
  2. +0 −1 _/js/functions.js
  3. +1 −5 archive.php
  4. +1 −1 category-blog.php
  5. +15 −11 category.php
  6. +10 −1 footer-public.php
  7. +1 −1 footer.php
  8. +1 −7 header-public.php
  9. +3 −1 home.php
  10. BIN screenshot.jpg
  11. BIN screenshot.png
  12. +33 −1 single.php
View
@@ -30,8 +30,8 @@ a:hover {
color:#CE1719;
text-decoration:underline;
}
-.entry-title, .entry-title a{font-family:"Microsoft YaHei", Helmet, Freesans, sans-serif;
-}
+.entry-title, .entry-title a{font-family:"Microsoft YaHei", Helmet, Freesans, sans-serif; }
+
.post p {
margin-bottom:5px;
line-height:1.4em;
@@ -81,10 +81,27 @@ body {
}
.post {
margin-bottom:20px;
+ padding:5px 0;
}
.page-wrap {
margin-top:20px;
}
+.page-wrap {
+ width:945px;
+}
+.home-content .page-wrap {
+ width:700px;
+}
+.home .page-wrap {
+ margin-top:0;
+}
+.home-content {
+ overflow-y:auto;
+ min-height:400px;
+}
+.home-content .li {
+ border-bottom:1px dashed #F0F0F0;
+}
.navigation {
clear:both;
margin:15px auto 0 auto;
@@ -132,7 +149,7 @@ body {
/* header
*/
.home #header {
- padding-top:80px;
+ padding-top:40px;
}
#header {
padding-top:20px;
@@ -231,6 +248,9 @@ li.current_page_item a {
.post h2 {
font-size:20px;
}
+.post h3 {
+ font-size:16px;
+}
.post header {
color:#333;
margin-bottom:10px;
@@ -239,11 +259,12 @@ li.current_page_item a {
margin-top:8px;
}
-.category header h2 {
+.category h3.entry-title {
display:inline;
}
-.category header .meta {
+.category .meta {
display:inline;
+ float:right;
margin-left:5px;
}
/* book
@@ -281,16 +302,9 @@ li.current_page_item a {
/* postgraduate
*/
-.category .category-postgraduate {
-
-}
-/* TODO */
.category article.category-postgraduate {
- display:inline;
- float:left;
- margin:10px 20px;
-}
+}
/* home
*/
View
@@ -65,7 +65,6 @@ exports.makeGallery= function(settings) {
/* trigger when page is ready */
-
$(document).ready(function(){
//左右键翻页
if ($('.navigation').length>0) {
View
@@ -1,7 +1,3 @@
<?php
- if (in_category('blog')) {
- include (TEMPLATEPATH . '/single.php' );
- } else {
- include (TEMPLATEPATH . '/category.php');
- }
+//有category.php的情况下会被覆盖
?>
View
@@ -1 +1 @@
-<?php include (TEMPLATEPATH . '/page.php' ); ?>
+<?php include (TEMPLATEPATH . '/category.php' ); ?>
View
@@ -9,7 +9,7 @@
if (have_posts()) :
while (have_posts()) : the_post();
$content= get_the_content();
- if ($name==="book" || $name==="postgraduate") {
+ if ($name==="book") {
// 著作, 提取img作为封面
$RE_SRC= '/<img[^>]*src="?([^ ">]*)"?[ >]/i';
preg_match($RE_SRC, $content, $t);
@@ -29,29 +29,33 @@
}
?>
- <article <?php post_class("clearfix") ?>>
<?php if ($name==="book") { ?>
+ <article <?php post_class("clearfix") ?>>
<div class="cover">
<img src="<?php echo $t?$t[1]:'' ?>" width="100" alt="" />
</div>
- <?php } ?>
<header>
- <h2 class="entry-title" id="post-<?php the_ID(); ?>"><a href="<?php echo $link ?>">
- <?php if ($name==="postgraduate") { ?>
- <div class="photo">
- <img src="<?php echo $t?$t[1]:'' ?>" width="100" alt="" />
- </div>
- <?php $content= "";
- } ?>
+ <h3 class="entry-title" id="post-<?php the_ID(); ?>"><a href="<?php echo $link ?>">
<?php the_title();?>
- </a></h2>
+ </a></h3>
<div class="meta">
<?php edit_post_link(__("编辑", 'tbdata'), '<span class="edit-link">', '</span>') ?>
</div>
</header>
<div class="entry">
<?php echo apply_filters('the_content', $content); ?>
</div>
+ <?php } else { ?>
+ <article <?php post_class("li clearfix") ?>>
+ <h3 class="entry-title" id="post-<?php the_ID(); ?>"><a href="<?php echo $link ?>">
+ <?php the_title();?>
+ </a></h3>
+ <div class="meta">
+ <?php edit_post_link(__("编辑", 'tbdata'), '<span class="edit-link">', '</span>') ?>
+ <span class="comment-count" style="color:#333;">(<?php echo get_comments_number(); ?>)</span>
+ <span><?php the_time("Y-m-d h:i") ?></span>
+ </div>
+ <?php } ?>
</article>
<?php endwhile;
include (TEMPLATEPATH. '/_/inc/nav.php');
View
@@ -73,5 +73,14 @@
<?php } ?>
</ul>
</nav>
-<!-- #items-->
+<script type="text/javascript">
+ //满屏高度
+(function($) {
+ $(document).ready(function() {
+ var h=document.body.clientHeight-$('div.home-nav').outerHeight()-$('#header').outerHeight()-$('#footer').outerHeight()-150;
+ if (h<400) h=400;
+ $('div.home-content').height(h);
+ });
+})(jQuery);
+</script>
<?php get_footer(); ?>
View
@@ -2,7 +2,7 @@
</div>
<footer id="footer" class="source-org vcard copyright">
- <p>
+ <p style="display:none;">
<a href="<?php bloginfo('url'); ?>">首页</a>
<span class="sep"> | </span>
<a href="<?php bloginfo('url'); ?>/archives/category/blog">博客</a>
View
@@ -1,10 +1,4 @@
<?php get_header(); ?>
-<style type="text/css">
- .home-content {
- width:800px;
- min-height:300px;
- }
-</style>
<header id="header">
<h1 class="logo entry-title clearfix"><a href="<?php bloginfo('url'); ?>" class="clearfix">
<img src="<?php bloginfo('template_directory'); ?>/_/img/logo.png" width="50" height="50" alt="<?php bloginfo('name'); ?>"/>
@@ -18,7 +12,7 @@
</a></h1>
</header><!-- #header -->
- <div class="home-content page-wrap clearfix">
+ <div class="home-content clearfix">
<!-- not needed? up to you: http://camendesign.com/code/developpeurs_sans_frontieres -->
View
@@ -7,7 +7,8 @@
<?php get_header('public'); ?>
<script type="text/javascript">
window.$= window.jQuery;</script>
-<div id="mainbox" class="grid-m0 col-main">
+<div class="content page-wrap grid-m0 clearfix">
+<div id="mainbox" class="col-main">
<div class="main-wrap">
<?php if (have_posts()) : ?>
<section id="imagebox">
@@ -40,4 +41,5 @@
</div>
</div>
+</div>
<?php get_footer('public'); ?>
View
Deleted file not rendered
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -3,7 +3,39 @@
if (in_category('blog')) {
include (TEMPLATEPATH . '/page.php' );
} else {
- include (TEMPLATEPATH . '/category.php');
+ $name= get_query_var('category_name');
+ get_header('public');
+?>
+<div class="content page-wrap grid-m0 clearfix">
+ <div class="col-main">
+ <div class="main-wrap clearfix" id="post-<?php the_ID(); ?>">
+<?php
+if (have_posts()) :
+ while (have_posts()) : the_post();
+?>
+ <article <?php post_class("clearfix") ?>>
+ <header>
+ <h2 class="entry-title" id="post-<?php the_ID(); ?>"><a href="<?php echo $link ?>">
+ <?php the_title();?>
+ </a></h2>
+ <div class="meta">
+ <?php edit_post_link(__("编辑", 'tbdata'), '<span class="edit-link">', '</span>') ?>
+ </div>
+ </header>
+ <div class="entry">
+ <?php the_content(); ?>
+ </div>
+ </article>
+ <?php //comments_template(); ?>
+ <?php endwhile;
+ // include (TEMPLATEPATH. '/_/inc/nav.php');
+ ?>
+<?php endif; ?>
+ </div>
+ </div>
+</div>
+ <?php
+ get_footer('public');
}
}
?>

0 comments on commit 6cb7ff6

Please sign in to comment.