jeudi 5 février 2015

Make 'blog' page show content as well as posts underneath it


I have a page called 'blog' and I want to have the blog pages content at the top of the page as an intro and then underneath a list of all the posts. I've run into quite a few issues I'm not sure how to get around. Here they are...



  • I have three posts at the moment, only post 1 and 3 are shown (post two isn't)

  • I'm including the excerpts of the posts but post 1 displays nothing and post 3 shows the correct excerpt of that post

  • On the search page (search.php) the same thing as above happens except that post 1 displays the content of the blog page itself as it's excerpt...?


So I was wondering how I could get around this all?


I'm using the following (I've removed the HTML/CSS so you can see the PHP better but kept the same layout of everything):



<?php wp_reset_postdata(); wp_reset_query(); ?>
<?php if (have_posts()) : ?>

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

<?php if ( has_post_thumbnail() ) : ?>

<?php the_post_thumbnail('thumbs'); ?>

<?php endif; ?>

<?php echo get_the_date('jS F Y'); ?>

<?php the_title(); ?>

<?php the_post(); ?> <?php echo substr(get_the_excerpt(), 0,200); ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>
<?php wp_reset_postdata(); wp_reset_query(); ?>


Any help on this please?





Aucun commentaire:

Enregistrer un commentaire