Support » Themes and Templates » Custom Ask page in WordPress does not work

  • Hi,

    I am using wordpress to create blog similar to 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, 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

Viewing 1 replies (of 1 total)
  • Chip Bennett


    Theme Review Admin

    That’s not how you link Pages in WordPress.

    If you’ve created a custom Page template, ask.php, in your Theme directory, you then need to create a Page within WordPress to use that template file.

    From your Dashboard, go to Pages -> Add New Page

    On the Edit Page screen, change the “Page Template” from “default” to “ask”. Give the Page a Title of “Ask” (can be whatever you want, but this is for the sake of the explanation here).

    Now Publish the Page.

    Now you should be able to access the Page via:

    <a href="<?php echo home_url(); ?>/ask"> ask</a>

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Ask page in WordPress does not work’ is closed to new replies.