Problem developing worpress blog template

1 replies
Hi,

Unfortunately my wordpress theme has no wordpress loop/blog. I'm working on a blog template in wordpress and I'm trying to get a few posts on one page with each post the same style with a little space between them. Unfortunately all posts are loaded into just one frame and not separate.

This is logical because the wordpress loop is in this case programmed between the divs who are referring to the css.

Can somebody tell me or put me in the right direction to make sure each post have his own framework?

Thanks in advance,
Hans

P.s. Here is the code I'm using

<?php

?>
<?php get_header(); ?>
<div id="bg">
<div id="content">
<div class="inner-index2">
<div class="jogobingo-index">
<article>

<?php // Display blog posts on any page @ Display Blog Posts on any Page (with navigation) | Digging Into WordPress
$temp = $wp_query; $wp_query= null;
$wp_query = new WP_Query(); $wp_query->query('showposts=1' . '&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>

<h3><a href="<?php the_permalink(); ?>" title="Read more"><?php the_title(); ?></a></h3>
</div>
<div class="titel">
<?php the_excerpt(); ?>

<?php endwhile; ?>

<?php if ($paged > 1) { ?>

<nav id="nav-posts">
<div class="prev"><?php next_posts_link('&laquo; Previous Posts'); ?></div>
<div class="next"><?php previous_posts_link('Newer Posts &raquo;'); ?></div>
</nav>

<?php } else { ?>

<nav id="nav-posts">
<div class="prev"><?php next_posts_link('&laquo; Previous Posts'); ?></div>
</nav>

<?php } ?>

<?php wp_reset_postdata(); ?>

</div>
</div>
</div>

</article>

<img class="bg_bottom" alt="" src="<?php bloginfo ('template_directory'); ?>/images/Realbingo_homepage-content.png" />
</div>

<?php get_footer(); ?>
#blog #developing #problem #template #worpress
  • Profile picture of the author danielml
    Ok, Looks like, for starters, your divs are not properly nested.
    I didn't test it, but try this.

    <?php get_header(); ?>
    <div id="bg">
    <div id="content">
    <div class="inner-index2">
    <div class="jogobingo-index">
    <article>

    <?php // Display blog posts on any page @ Display Blog Posts on any Page (with navigation) | Digging Into WordPress
    $temp = $wp_query; $wp_query= null;
    $wp_query = new WP_Query(); $wp_query->query('showposts=1' . '&paged='.$paged);
    while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <div class="my_post">
    <h3><a href="<?php the_permalink(); ?>" title="Read more"><?php the_title(); ?></a></h3>
    <div class="titel">
    <?php the_excerpt(); ?>
    </div>
    </div>

    <?php endwhile; ?>

    <?php if ($paged > 1) { ?>

    <nav id="nav-posts">
    <div class="prev"><?php next_posts_link('&laquo; Previous Posts'); ?></div>
    <div class="next"><?php previous_posts_link('Newer Posts &raquo;'); ?></div>
    </nav>

    <?php } else { ?>

    <nav id="nav-posts">
    <div class="prev"><?php next_posts_link('&laquo; Previous Posts'); ?></div>
    </nav>

    <?php } ?>

    <?php wp_reset_postdata(); ?>

    </article>
    </div>
    </div>
    </div>

    <img class="bg_bottom" alt="" src="<?php bloginfo ('template_directory'); ?>/images/Realbingo_homepage-content.png" />
    </div>

    <?php get_footer(); ?>
    {{ DiscussionBoard.errors[8868659].message }}

Trending Topics