Custom Blog Post Listing in Genesis Sample Child Theme

I want to add several images and divs and also customize the look of my Blog post listing… But i can’t find the way to do it.

Here’s the Blog Template code

Read More
<?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();

and just above the genesis(); code.. i tried to put some divs and images there.. But i guess that’s not the way it works. ..

I also tried to make my own Blog listing template using a normal wordpress code theme..

<?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 »', '1 Comment »', '% Comments »'); ?>
    </div>
  </div>
  <?php endwhile; ?>
  <?php else : ?>
  <h2>Not Found</h2>
  <?php endif; ?>
  <?php genesis_after_loop(); ?>
</div>
<?php get_footer(); ?>

But no luck, what’s the right way to do this?

***Update -code below is the one i want.. but instead of having the Content of the page. I want the list of Post with excerpts ….How can i do that????

<?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(); ?>

Related posts

Leave a Reply

1 comment

  1. Im shocked that no one answered my question.. anyway, if someone bumps onto this post with similar problem. The answer is adding

    <?php query_posts( $args );  ?>
    

    just above the <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    All in all, my code looks like this …

    <?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 »', '1 Comment »', '% Comments »'); ?>
          </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(); ?>