I followed this tutorial for the page specific template — http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
Created a page through wordpress admin panel – Blog Page URL like — http://localhost/wordpress/blog-page/ and set template to my template “Swapnesh” from the admin panel itself.
Created my specific page template as page-blog-page.php containing following code —
<?php
/*
Template Name: Swapnesh
*/
get_header(); ?>
<div id="primary">
<div id="contentabc" style="border:7px solid red;">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
<?php get_sidebar(); ?>
</div><!-- #primary -->
<?php get_footer(); ?>
Now when im navigating to http://mysite/wordpress/blog-page/ im not getting that border so that i can proceed further, let me know what im doing wrong.
note— Under “Reading Settings” mu post page selection was “Blog Page” when i dis select this option its showing me the red border but no posts then 🙁
I don’t know if you’ve solved this yet but I think the problem relates to the belt and braces approach you’ve ended up with here. By naming your custom template page-blog-page.php it should negate the need to explicitly assign it as a custom template for a page with the slug blog-page.
Try changing the name of the custom template completely – my-template.php – to see what happens. I don’t see anything obviously wrong with your code.