Support » Fixing WordPress » Link to a Page

  • Resolved unicom68


    <!– begin footer –>

    <?php get_sidebar(); ?>

    <p id=”credits”>

    © Copyright <?php echo date(“Y”).” “; bloginfo(‘name’); ?>. All rights reserved.

    Powered by WordPress . <?php wp_loginout(); ?>



    <?php do_action(‘wp_footer’); ?>

    <!– begin testpage –>

    <?php get_header(); ?>

    <div id=”bloque”>
    <div id=”noticias”>

    <h2 class=”center”>Test</h2>


    This is a test page.


    <?php get_footer(); ?>


    Above are two scripts that I have composed. I would like to link to ‘test.php’ when one click at the footer – test. However, no matter how hard I tried, I can never link successfully to the test.php. I have even modified the test.php to html format. But it simply don’t work. Can anyone advice?

    Many Thanks!

Viewing 15 replies - 1 through 15 (of 15 total)
  • You can never link directly to any template files.
    What is it what you want to do? Don’t tell me HOW (since obviously, that didn’t work), tell me WHAT do you want to achieve.

    I want to display the disclosure terms. I understand that I can easily achieve that by creating a new page. However, as disclosure is not meant to be main topic, i thought it is neater to have that separate link where when one click – ‘disclosure’ in the footer, the disclosure will be displayed out. Please advice how that can be done. Thanks.

    You still should go by creating a new Page. You will exclude it from showing up among your other Pages – for that you need to read the documentation!

    and then make a link from your footer.php to that hidden Page.

    Ok, according to the documentation, the page can be excluded by the following script:

      wp_list_pages(‘title_li=’); ?>


    I have two questions:
    1 Where should I add this? In the Stylesheet? Main Index Template? Page Template?
    2 How do I link to that page from the footer?


    Ok, I noted that I can use the following code to exclude a page:

    <?php wp_list_pages(‘exclude=arguments’ ); ?>

    Based on the tutorial, I would like to know whenever I write a page, it will create a page no automatically? So if blog = page 1, about = page 2 and so on. In this case, if I want to exclude a page, say page 3, is it write to just

    <?php wp_list_pages(‘exclude=3’ ); ?>

    I tried that, but it doesn’t work.

    Likewise, for the linking to the page, I understand the code is

    <?php wp_link_pages(‘arguments’); ?>

    but how could I first display the word say ‘disclosure’ so that when one click on the word ‘disclosure’ it will point to the disclosure page?

    try using <?php wp_list_pages(‘exclude=3’); ?>

    replace link with list… as for the display name in the Post Title field use ‘Disclosures’ or whatever you want the display name to be and that should take care of it

    I use the include and exclude code all the time and never had a problem with it.

    the following string of code is directly from my website you may want to try and use all of the arguments and add your exclude to it..

    <?php wp_list_pages(‘sort_column=menu_order&title_li=&include=2,9’); ?>

    replace inlcude=2,9 with exclude=3

    Thanks. But it don’t work.

    Hi SRmarketing, I managed to sort out the reason. Your command is right. The reason it did not work is because, I was not aware that the number is actually dispalyed in post and page. I thought, by default the blog page is 0, the About page is 1 and so on…After I make the changes accordingly, I managed to exclude pages that I don’t wish to display.

    However, I am still not able to link to the footer wording ‘disclosure’ to the disclosure page. Any recoomendations?

    Many thanks!

    Hi moshu, how could I make the link in the footer.php to a page? This is the command line that I included in the footer.php:


    assuming 39 is the page that I am linking to. It is not working!

    Your advice please. Many thanks!

    Sorry for the typo error, the command line should read as follows:


    Thanks and Regards.

    Hi moshu, pardon me, I am confused. When I create a new page from WordPress and say ‘Disclosure’ how could I link at the footer.php to that ‘disclosure’ page? I have searched in the director but I could not find the page that is named ‘disclosure’. Where is ‘discloure’ located? Also, I thought it is not possible to link page within the blog?


    Maybe, I should put it another way, I had used wordpress to create ‘disclosure’ page. But where can I find that page so as to establish the link using the html command as recommended by you? I have search throughtout the directory but found nothing like ‘disclosure.html’ or something close to!


    Don’t make it more difficult than it is 🙂
    If you already created the Page – go admin > Manage > Pages. You will see a list of them. Next to your disclosure Page click View. It will take you tot THAT Page. Copy the address that you see in your browser’s address bar.
    Make a normal html link (anchor) with that address in your footer.php.

    Hi moshu, yup, it’s that easy! Many Thanks!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Link to a Page’ is closed to new replies.