Hi, i have started learning how to build wordpress themes and have a problem with the code below
Please can you help me to find where the problem is? Thank You!

    <?php  get_header(); ?>

                <section class="container layout">

                    <section class="page_title">
                        <div class="title">Blog style 1</div>
                        <div class="slogan">Curabitur ultrices ultricies justo</div>
                    <div class="clear"></div>

                    <section class="grid_8">
                        <section id="blog">
                       <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
                            <!--============= ARTICLE BEGIN ===========-->

                            <article class="style1">
                                <div class="grid_3 img_pf_hover alpha"><a href="blog_post.html"><img src="<?php bloginfo('template_directory') ?>/images/assets/5.png" class="img212x142" alt="" /></a></div>
                                <!-- Article thumbnail end -->

                                <div class="grid_5 omega">
                                    <div class="title"><h2><a href="blog_post.html">Qudos volutpat mattis tincidunt</a></h2></div>
                                    <div class="clear"></div>
                                    <div class="meta_data">Posted by <a href="#">Smartik</a> on October 11, 2011 in <a href="#">Web Design</a> category</div>
                                    <div class="clear"></div>

                                    <p>Donec eleifend pretium nunc. Vestibulum ac tortor ut nisi hendrerit tincidunt quis in felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam fermentum semper ligula ac bibendum...</p>
                                    <div class="clear"></div><!-- Article description end -->
                                <div class="clear"></div>
                            <div class="clear"></div>
                            <!--============= ARTICLE END ===========-->

                        </section> <!-- End #blog -->
                    <?php get_sidebar(); ?>
                </section> <!-- End section .container layout -->

                <?php get_footer(); ?>
            </section><!-- End section .wrap_block -->
        </section> <!-- End section #wrap -->

Recommended Answers

All 4 Replies

Urgh, haven't done any work with Wordpress in a while (Because it's just quite frankly horrible to work with)
BUT, from looking at your code, you open up an if statement, as well a while loop. Where do you close these? so e.g.




I think the code is, but I'm not too sure.. This is why you could be getting the $end

phorce is correct but they should be the other way around:





You are also missing your semi-colon after calling the template_directory

@simplypixie - My bad, I haven't done anyt wordpress in about a year. I refused to learn it!

Thank you guys/ The problem was just closing the loop with <?php endwhile; ?>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.