Support » Fixing WordPress » Creating single dynamic PHP links to WP pages

  • Resolved nosleephotel


    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:

    <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>

    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?

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

Viewing 1 replies (of 1 total)
  • The topic ‘Creating single dynamic PHP links to WP pages’ is closed to new replies.