Dec072011

How do I send user from one page to specific part of another page in WordPress?

Niks asks:

How do I send user from one page to specific part of another page in WordPress?

For example when the user clicks the link on page 1, he should be redirected to specific part of page 2. Like MakeUseOf has in their “Best Of” section.

If we click on Antivirus option, it sends us to section with the list of AV. Likewise for other options. But I need this to work for redirecting page to another.


Know someone who can answer? Share the question with your friends!

Leave a comment

Get a MakeUseOf account using one of your online accounts below.
Why? Earn points, unlock giveaways, access locked exclusives.

Hide 5 Comments

  • Jeff Fabish December 7, 2011

    Hi Niks,

    You need to create a ‘bookmark’. Find the element of the page that represents the data you want to link to and assign it an ID. Then, when you hyperlink to it just append “#TheIdYouCreated” where “TheIdYouCreated” is the ID you assigned to the tag.

    Here is an example:

    <!– The ID you want to link to –>
    <p id=”Software”>Here is the best software!</p>

    <!– The link to the ID (replace ‘site.com’ with your domain and ‘page.html’ with the relative location of the script –>
    <a href=”site.com/page.html#Software”>Go to software</a>

    • Niks December 8, 2011

      Thanks a lot !! It worked . BTW will this also work for Blogger/Blogspot ?

      • Jeff Fabish December 8, 2011

        Niks,

        Your welcome! Yes, this will work for blogger as well. 

Please wait...