I am using wordpress to create blog similar to stackoverflow.com where users can ask questions. I decided that since my Ask page is “same all the time” I create a new page called ask.php. This page will contain the FORM. The problem is that i cannot link that page correctly.
In the header template I give the link to my ask page. I believe this link links to custom php file in my themes folder *wp-content\themes\mythemename*
<a href="<?php echo get_bloginfo('template_directory'); ?>/ask.php"> ask</a>
For the sake of simplicity the contents of my Ask (ask.php) page is just ‘diplay one header’, no loop no footer etc.
<?php get_header(); ?>
The problem when i click on the ask link an empty page is opened. When i hover mouse over the link I can see the link is correct http://mysitename.com/wp-content/themes/own/index.php, where ‘own’ is my theme folder.
And this this a problem I created different php pages and changed the link accordingly but always an empty page is opened. Even when I try to give link to index.php
<a href="<?php echo get_bloginfo('template_directory'); ?>/index.php"> Home</a>
First you’re ask.php theme file should contain the following lines at the top :
Then add a new page from wp-admin called Ask , and from the right sidebar on the edit page select the template
Askfor this page . Everithing should work just fine .p.s. don’t include a link to the file in you’re header but instead let wp list the page with the permalink you’ve set in wp-admin when you added the page .