Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Problem developing worpress blog template (https://www.warriorforum.com/programming/890868-problem-developing-worpress-blog-template.html)

snahtter 14th January 2014 08:54 AM

Problem developing worpress blog template
 
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(); ?>

danielml 14th January 2014 11:01 PM

Re: Problem developing worpress blog template
 
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(); ?>


All times are GMT -6. The time now is 11:40 AM.