• I’m trying to manipulate a template file in, so it show all the posts with the featured image. The code underneath works but i can style the thumbnails.. I’m working in the bones theme. I know is hard to help when you can′t see the css but I’m working locally.. But can someone at least tell me if I’m doing the php correct?

    Many thanks

    Kristian

    <?php $args = array( 'numberposts' => -1 );
                $postlist = get_posts($args);
                foreach ($postlist as $post) {
                    setup_postdata($post);
                    if (has_post_thumbnail()) {
                        echo '<section class="entry-content clearfix">';
                        the_post_thumbnail('bones-thumb-601');
                        echo '<h5>';
                        the_title();
                        echo '</h5>';
                        echo '</section>';
                    }
                }
            ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Display posts on one page’ is closed to new replies.