[wp-hackers] wordpress loop help

Saša Pršir sashaprsheer at gmail.com
Wed Apr 17 07:23:37 UTC 2013

I am having trouble with my wordpress loop. It pulls out the pages instead
posts. I have three posts(My first post,My second post, My third post) and
three pages(home, about, contact)... and when i do this

<div id="primary">

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

                <div class="post-item">
                    <img src="<?php echo bloginfo('template_directory') .
'/img/postImages/one.jpg'; ?>" alt="post image" />
                    <h2><a href="<?php the_permalink() ?>"><?php
the_title(); ?></a></h2>
                    <p class="meta">4/1/09 in Inspiration</p>
                        Lorem ipsum dolor sit amet, sit diam ut sed jus
consequat nunc incassum fatua,
                        sed genitus, virtus, saepius pagus. Autem bene
ingenium aptent aliquam inhibeo,
                        accumsan nonummy proprius pneum reprobo letalis
vindico duis elit.
                </div> <!-- end post-item -->

                <?php endwhile; ?>
                <?php else : ?>

                <p>I'm not sure what you're looking for.</p>

                <?php endif; ?>

                <a href="#" class="more">More...</a>

            </div><!-- end primary -->

it takes out pages title?

More information about the wp-hackers mailing list