Forums

About Page link (5 posts)

  1. Aruz
    Member
    Posted 3 years ago #

    I wanna put a link of About page at footer for my new theme. The About page's address is will be unknown. It may be http://site/about or http://site/?page_id=16 etc. But the name is About. This is only knowledge that I have.
    How can I find page address with page name?
    I tried this but dont working. get_query_var('About')
    Thanks for your time...

  2. Eric Amundson
    Member
    Posted 3 years ago #

    If I'm understanding you correctly, I'd do something like this:

    <a href="<?php echo get_permalink(2); ?>">About</a>

    . . . where the (2) represents the page ID. This will insert the proper URL and permalink, regardless of your permalink scheme.

  3. Aruz
    Member
    Posted 3 years ago #

    There is only page name. For example I make Authors.php, and template name is "Authors Template". And want to put a link of "Authors Template" in the footer. It will be a link of "Authors Template" in the footer. I cant know the my theme users "Authors Template" page id.
    I looking for something like this.

    <a href="<?php echo get_page_permanent_link('Authors Template'); ?>">Authors</a>
    <a href="<?php echo get_page_permanent_link('Authors Page Name'); ?>">Authors</a>

    Thanks...

  4. Eric Amundson
    Member
    Posted 3 years ago #

    I'm sorry - I don't quite understand.

    Are you making a theme for yourself, or for distribution?

    If you're linking to a page within a WordPress site, you can do it based on the ID of the page or post, but you'd never link to the page template; you'd just set that page to use the template through the Admin panel.

    If you're creating a theme for other people to use and you're not sure which page ID/name etc that they'll be using, then I'm not sure there's much you can do except not link it and provide instructions on changing it in the readme.txt file.

  5. Aruz
    Member
    Posted 3 years ago #

    I am making for distribution. Ok. Thanks a lot.

Topic Closed

This topic has been closed to new replies.

About this Topic