2013-08-01 37 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(); ?> 
相關問題