Forums

Anchor with page_id? (6 posts)

  1. metagoo
    Member
    Posted 5 years ago #

    Very simply, I'd like to link from my home page to a specific spot (a named anchor) in another page. That other page has a page_id of 2.
    If it was a regular link, I'd have written href=/pagename.php#anchorname, but of course the page is identified with a parameter that follows the question mark.

    I tried href=/#anchorname/?page_id=2, that did not work.

    Without going the plugin route, is there a way to do this with just a little html and/or php? Maybe pass another name-value pair and then write a line of PHP on the recieving page to direct the viewer down to the anchor?

    Thanks in anticipation

    Dan

  2. moshu
    Member
    Posted 5 years ago #

    /?page_id=2#anchorname

  3. metagoo
    Member
    Posted 5 years ago #

    Really? I'll be stunned if that works!

  4. metagoo
    Member
    Posted 5 years ago #

    I'm officially stunned. Many thanks! I did not even try that originally, thought it looked wrong syntax-wise... but no

  5. libujar
    Member
    Posted 5 years ago #

  6. Eric Amundson
    Member
    Posted 5 years ago #

    You could also use permalinks to avoid the ?.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags