WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Creating single dynamic PHP links to WP pages (2 posts)

  1. nosleephotel
    Member
    Posted 5 years ago #

    I've done a fair share of searching the codex, support forum and google and couldn't find my question answered so I'm creating a thread for it.

    I want to have a relative link in my main menu navigation. Here's what I have so far:

    <ul>
    <li class="home"><a id="home" href="#nogo" title="Home">Home</a></li>
    <li class="about"><a id="about" href="#nogo" title="About Clark">About Clark</a></li>
    <li class="gallery"><a id="gallery" href="#nogo" title="Gallery">Gallery</a></li>
    <li class="blog"><a id="blog" href="#nogo" title="Blog">Blog</a></li>
    <li class="contact"><a id="contact" href="#nogo" title="Contact">Contact</a></li>
    </ul>

    I would like to have the href point (replacing "#nogo" to a specific page using a relative path. I'm thinking the best way to do this is use some php code that creates the link based on it's page #? I just don't know what the php would be. Can someone help me out?

  2. nosleephotel
    Member
    Posted 5 years ago #

    I ended up finding the answer inadvertently when working on something else. I used <?php bloginfo('home');?> followed by "/about" or whatever the slug was. Hope this helps someone else.

Topic Closed

This topic has been closed to new replies.

About this Topic