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

Niks December 7, 2011
Pinterest Stumbleupon Whatsapp

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.

Ads by Google

  1. Jay
    December 8, 2011 at 4:00 am
  2. Jeff Fabish
    December 7, 2011 at 11:11 pm

    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 at 8:53 am

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

      • Jeff Fabish
        December 8, 2011 at 2:32 pm

        Niks,

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

        • Niks
          December 8, 2011 at 4:22 pm

          Thanks again :)