• 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 https://site/about or https://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…

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Thread Starter Aruz

    (@aruz)

    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…

    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.

    Thread Starter Aruz

    (@aruz)

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘About Page link’ is closed to new replies.