Need Help – > Custom Blog Page.
-
Hi Experts,
I am new to wordpress and created a wordpress website from scratch. I want to make a custom blog page with blog posts. currently I created a page called blog.php with the following code.<?php /* Template Name: Blog */ ?> <?php get_header(); ?> <div id="content"> <div id="main"> <div class="textbox"> </div><!--textbox--> </div> <!--main--> <?php get_sidebar(); ?> </div> <!--content ends--> <?php get_footer(); ?>
I want to show my post inside the div class =”textbox”. currently I am using the following code to show the posts but no post is showing there on the page.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?>
Kindly help me and suggest me how can I get posts on my blog.php page.
Thanks in advance
Kind Regards
Jarnail Singh
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Need Help – > Custom Blog Page.’ is closed to new replies.