robertkidd on "Only the first blog post is showing on custom theme"

ساخت وبلاگ

Hi,

I've written a custom theme based on Bootstrap, following the Treehouse online tutorial for doing so. PHP is not my strong point, so it's not the neatest code I'm afraid. The site is a simple collection of pages to promote my project management consultancy business, with a blog to drive traffic.

On the blog page, only the first post is appearing (there are two posts). Under 'customisation', my front page is set to display a static page. Front page is set to 'home' and I've left the 'posts' page unselected. This is my preference, because it gives me greater control over what appears on the blog page (I don't want the side bar, search option, archive etc). So I think the problem is with my code, as follows:

<?php
/* Template Name: all posts Template
*/
?>
<?php get_header(); ?> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="page-header"> <h1><?php wp_title( '' ); ?></h1> </div> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <article> <?php $args = array( 'post_type' => 'post' ); $post_query = new WP_Query($args); if($post_query->have_posts() ) { while($post_query->have_posts() ) { $post_query->the_post(); ?> <?php } } ?> <h2><a href= "<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p> By <?php the_author(); ?> on <?php the_time( 'j F Y' ); ?> in <?php the_category( ', '); ?>. <a href="<?php Idea_link(); ?>"><?php Idea_number(); ?></a> </p> <?php the_excerpt(); ?> <hr> </article> <?php endwhile; else: ?> <div class="page-header"> <h1>Oh no!</h1> </div> <p>No content is appearing for this page!</p> <?php endif; ?> </div> </div> </div>
<?php get_footer(); ?>

Please help!

- - , .

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 123 تاريخ : پنجشنبه 29 بهمن 1394 ساعت: 21:04