2013-08-01 38 views
1

我想添加几个图像和divs,并自定义我的博客帖子列表的外观...但我找不到办法做到这一点。自定义博客张贴在创世纪样本儿童主题

这里的博客模板代码

<?php 
/* 
WARNING: This file is part of the core Genesis framework. DO NOT edit 
this file under any circumstances. Please do all modifications 
in the form of a child theme. 
*/ 

/** 
* Template Name: Blog 
* This file handles blog post listings within a page. 
* 
* This file is a core Genesis file and should not be edited. 
* 
* The blog page loop logic is located in lib/structure/loops.php 
* 
* @category Genesis 
* @package Templates 
* @author StudioPress 
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later) 
* @link  http://www.studiopress.com/themes/genesis 
*/ 
genesis(); 

,略高于genesis();代码..我试图把一些div和图像有..但我想这不是它的工作方式。 ..

我也试图让使用WordPress的正常主题代码我自己的博客模板上市..

<?php /* 
Template Name: List Post Pages 
*/ 
?> 
<?php get_header(); ?> 
<?php if (has_post_thumbnail()) { ?> 

<div class="featured"> 
    <?php the_post_thumbnail(); ?> 
</div> 
<?php } ?> 
<div class="divider"></div> 
<div id="content" class="hfeed"> 
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?> 
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> 
    <h2><a href="<?php the_permalink() ?>"> 
     <?php the_title(); ?> 
     </a></h2> 
    <div class="entry"> 
     <?php the_content(); ?> 
    </div> 
    <div class="postmetadata"> 
     <?php the_tags('Tags: ', ', ', '<br />'); ?> 
     Posted in 
     <?php the_category(', ') ?> 
     | 
     <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?> 
    </div> 
    </div> 
    <?php endwhile; ?> 
    <?php else : ?> 
    <h2>Not Found</h2> 
    <?php endif; ?> 
    <?php genesis_after_loop(); ?> 
</div> 
<?php get_footer(); ?> 

,但没有运气,什么是应该做的正确方法?

***更新下面的代码是我想要的..但​​不是有页面的内容。我想要的文章列表与节选....我怎么能做到这一点?

<?php /* 
Template Name: Page Template 
*/ ?> 
<?php get_header(); ?> 
<?php if (has_post_thumbnail()) { ?> 

<div class="featured"> 
    <?php the_post_thumbnail(); ?> 
</div> 
<?php } ?> 
<div class="divider"></div> 
<?php genesis_before_content_sidebar_wrap(); ?> 
<div id="content-sidebar-wrap"> 
    <?php genesis_before_content(); ?> 
    <div id="content" class="hfeed"> 
    <?php genesis_before_loop(); ?> 
    <?php genesis_loop(); ?> 
    <?php genesis_after_loop(); ?> 
    </div> 
    <!-- end #content --> 
    <?php genesis_after_content(); ?> 
</div> 
<!-- end #content-sidebar-wrap --> 
<?php genesis_after_content_sidebar_wrap(); ?> 
<?php get_footer(); ?> 

回答

2

我震惊,没有人回答我的问题..无论如何,如果有人碰到类似的问题这个职位。答案是刚刚<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

上面加了

<?php query_posts($args); ?> 

所有的一切,我的代码看起来像这样...

<?php /* 
Template Name: Page Template 
*/ ?> 
<?php get_header(); ?> 
<?php if (has_post_thumbnail()) { ?> 

<div class="featured"> 
    <?php the_post_thumbnail(); ?> 
</div> 
<?php } ?> 
<div class="divider"></div> 
<?php genesis_before_content_sidebar_wrap(); ?> 
<div id="content-sidebar-wrap"> 
    <?php genesis_before_content(); ?> 
    <div id="content" class="hfeed"> 
    <?php genesis_before_loop(); ?> 
    <?php query_posts($args); ?> 
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?> 
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> 
     <h2><a href="<?php the_permalink() ?>"> 
     <?php the_title(); ?> 
     </a></h2> 
     <div class="entry"> 
     <?php the_content(); ?> 
     </div> 
     <div class="postmetadata"> 
     <?php the_tags('Tags: ', ', ', '<br />'); ?> 
     Posted in 
     <?php the_category(', ') ?> 
     | 
     <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?> 
     </div> 
    </div> 
    <?php endwhile; ?> 
    <?php else : ?> 
    <h2>Not Found</h2> 
    <?php endif; ?> 
    <?php genesis_after_loop(); ?> 
    </div> 
    <!-- end #content --> 
    <?php genesis_after_content(); ?> 
</div> 
<!-- end #content-sidebar-wrap --> 
<?php genesis_after_content_sidebar_wrap(); ?> 
<?php get_footer(); ?> 
相关问题