• Hi ,
    i am trying to create a custom page template for showing the blog post .
    This is my current code :

    <?php
    /*
    * Template Name: Custom Blog Template
    * Description : Page template for dysplaing blog posts

    */
    ?>

    <?php get_header(); ?>

    <?php get_template_part( ‘template-part’, ‘head’ ); ?>

    <!– start content container –>
    <div class=”row rsrc-content”>

    <div class=”post-wrap”>

    <?php

    // theloop
    if ( have_posts() ) : while ( have_posts() ) : the_post();

    /* Include the Post-Format-specific template for the content.
    * If you want to overload this in a child theme then include a file
    * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    */
    get_template_part( ‘content’, get_post_format() );

    endwhile;

    the_posts_pagination();

    else:

    get_template_part( ‘content’, ‘none’ );

    endif;
    ?>

    </div>

    </div>
    <!– end content container –>

    <?php get_footer(); ?>

    The above code displays a page with title and “read more ” button but without posts. What am i doing wrong ?
    Thank you

  • The topic ‘How to create custom blog template’ is closed to new replies.