Php – wordpress page template is not working

PHPWordpress

I am working on theme and i want to create page template may code is below :

<?php
/*
Template Name: Blog
*/
?>

<?php get_header(); ?>

<div id="content">

<div class="left">

<div class="pagina">

</div>

</div>
</div>

<?php get_footer(); ?>

I have creat page name Blog and assign it a custom template from dropdown Blog,But when I click on navigation element Blog it shows The requested URL /wp/blog/ was not found on this server.

anyone can help?

Best Answer

I'd suggest this is a permalink issue, not a template issue. Your .htaccess file should be writable and you should have some code automatically added to it when you set up the permalinks. Check that it is writable and try setting the permalinks up again. Failing that, I believe that WordPress gives you the code to copy/paste into it when you're setting up the permalinks.

In short, add this code to your .htaccess file, if it's not there already.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Related Topic