This website uses cookies to personalise ads and to analyse traffic ok
web design

Page scroll to id for WordPress

Page scroll to id is a fully featured WordPress plugin for creating links that scroll the page smoothly to any id within the document. The plugin replaces browser’s “jumping” behavior with a smooth scrolling animation, when links with href value containing # are clicked.
It provides all the basic tools and advanced functionality for single-page websites, in-page navigation, back-to-top links etc. with features like: adjustable scrolling animation duration and easing, link and target highlighting via ready-to-use CSS classes, vertical and/or horizontal scrolling, scrolling from/to different pages etc.

Get started

The plugin works by “connecting” links with href/URL in the form of #my-id or to sections/elements within the document with an equivalent id attribute value (e.g. <div id="my-id">...</div>). Clicking such links will scroll the page smoothly to their target id position.

Get started by creating or setting-up your links. The plugin is enabled by default on WordPress Menu links (created in Appearance → Menus), so you can start adding custom links and set their URL to the id/target you want to scroll to (e.g. #my-id, /page/#my-id, etc.).
You can use id values that already exist in your theme or you can create your own id targets using plugin’s “Insert Page scroll to id target” button in wp post visual editor or the [ps2id] shortcode (e.g. [ps2id id='my-id'/]).

To create links within your content, use plugin’s “Insert/edit Page scroll to id link” button and/or shortcode (e.g. [ps2id url='#my-id']link text[/ps2id]) in wp post visual/text editor.
To enable the plugin on existing links, add the ps2id class or the m_PageScroll2id rel attribute to them, making sure the link’s href/URL value contains a hash (#) with the id of the section you want to scroll-to. In addition, you can simply add your links CSS selector (e.g. .menu-item a, a[href*=#]:not([href=#]) etc.) in “Selector(s)” field in plugin settings.

To highlight your links (or targets), use the classes provided by the plugin in your theme’s stylesheet or custom CSS. The default highlight class is mPS2id-highlight but you can set your own in the “Classes & highlight options”. For example, to style the highlighted link (the link whose target element is considered to be within the viewport), you could add in your CSS:
a.mPS2id-highlight{ background: #ff0; } or .menu-item a.mPS2id-highlight{ background: #ff0; } for highlighting custom menus links only.

If you have a fixed-positioned/sticky menu which overlaps your target’s content when page scrolling is completed, insert your menu CSS selector or a fixed pixel value in the “Offset” field. For example, inserting #navigation-menu will offset the scroll-to position according to the height/width/position of the element with id navigation-menu. In the same manner, setting the “Offset” value to 100 will offset page scrolling by 100 pixels.

Plugin settings


Use the Selector(s) field when you need to instruct the plugin to handle specific links. The value(s) should be anchor tags (a, i.e. links) in the form of strings that represent ways of choosing elements in the DOM (i.e. CSS selectors).
Each selector is separated by comma, so multiple selectors can be defined as: selector1, selector2, selector3 etc.

The default selector value is a[rel='m_PageScroll2id'], meaning the plugin handles by default all anchor elements (a) with m_PageScroll2id rel attribute value.
Other selector examples could be: a[href*='#'] (links that contain # in their href/URL attribute), a[href='#my-id'] (links with href attribute value: #my-id), a.className (links with class: className).

To enable the plugin on any link that has a hash (#) in its URL, insert a[href*=#]:not([href=#]) as a single selector.

Other default selectors which the plugin is applied automatically include the class ps2id (actual selectors: .ps2id > a[href*='#'] and a.ps2id[href*='#']). This means that any link with a hash in its URL/href (e.g. #my-id) which has the class or is contained (direct children) within an element with the class ps2id will be handled by the plugin automatically.

The option “Enable on WordPress Menu links” (enabled by default) enables the plugin automatically on custom links created in WordPress Menus.

Scroll duration

Scroll animation duration (i.e. scrolling speed) in milliseconds (1000 milliseconds equal 1 second). Lower values equal faster scrolling.

“Auto-adjust scrolling duration” option (enabled by default) lets the plugin fine-tune scrolling duration/speed according to target and page scroll position. This normalizes the animation duration in order to avoid short-distance scrolling taking too long (e.g. a page scroll of just 100 pixels will last shorter than the value specified in “Scroll duration”).

Scroll type/easing

Scroll animation easing type (i.e. the way the animation progresses at different points within its duration).
You can set different easing types according to page scrolling state: one that is applied when the page is idle (no scrolling currently running) and another that applies while page is scrolling (when a link is clicked while the page is animated/scrolling).

Scroll duration and easing demo

Scroll behavior

Always scroll smoothly when reaching the end of the page/document option adjusts scroll-to position so it does not exceed document length. For example, when scrolling to a target element that is at the bottom of the page, the scrolling animation stops smoothly at bottom of the page instead of “breaking” at an earlier point.
Enable Stop page scrolling on mouse-wheel or touch-swipe option if you want to stop page scrolling when the user tries to scroll the page manually (e.g. via mouse-wheel or touch-swipe).

Page layout

Set page scrolling direction (i.e. restrict scrolling) to top-bottom (vertical) or left-right (horizontal) accordingly. For both vertical and horizontal scrolling select auto.
This option does not transform your theme’s templates layout (i.e. it won’t change your theme/page design from vertical to horizontal).


Offset scroll-to position by x amount of pixels or by selector. The offset value can a be a positive or negative number (indicating pixels), or a matching set of elements in your html (selector). For example, setting the value to 50 will stop page scrolling 50 pixels before reaching the target.
If you need to offset scrolling according to the height (or width) of some element (e.g. according to a responsive/sticky navigation menu), insert the element’s selector in the Offset field. For example, if you have a top fixed/sticky menu with id navigation-menu, set the offset value to #navigation-menu in order to stop page scrolling below it and avoid the menu overlapping your content.

To set different vertical and horizontal offsets (e.g. when Layout is set to auto), add comma separated values in Offset field, e.g. 100,50 (vertical offset 100 pixels, horizontal offset 50 pixels).

The plugin offers selector expressions in order to define more advanced offset values. Examples:

  • :fixed expression – Offset by element with id “some-id” and CSS position fixed: #some-id:fixed
    Assuming vertical layout, the value above will offset scrolling according to the height of #some-id element (i.e. the element that has id some-id), but only when this element CSS position is fixed (i.e. element is sticky). This is useful when for example you have a navigation menu that is sticky/fixed only above a specific viewport size (e.g. only on desktop).
  • :height() expression – Offset by element with class “some-class” and height equal to 100 pixels: .some-class:height(100)
    The value above will offset scrolling according to the height (on vertical layout) of .some-class element (i.e. the element that has class some-class), but only when this element height is exactly 100 pixels.
  • :width() expression – Offset by element with id “some-id” and width greater than 800 pixels: #some-id:width(>800)
    The value above will offset scrolling according to the height of #some-id element, but only when this element width is greater than 800 pixels. This is useful when having responsive navigation menus. For instance, you might have a responsive top sticky menu that switches to a “hamburger” menu when viewport is 800 pixels wide or less. Assuming the menu is as wide as the page/viewport, you’d only want to apply its height as offset when its width is greater than 800 pixels (i.e. when it’s not “hamburger” menu). Adding: #your-menu-id:width(>800) as the offset value will do exactly that.
  • Multiple expressions – Offset by element with id “some-id”, CSS position fixed and height between 50 and 100 pixels: #some-id:fixed:height(>50):height(<100)
    The value above will offset scrolling according to the height of #some-id element, but only when this element CSS position is fixed and its height is anywhere between 51 and 99 pixels.

Highlight selector(s)

The matching set of elements (i.e. selectors) handled by the plugin, that will be eligible for highlighting. The value(s) should be anchor tags (a, i.e. links).

The plugin highlights by default all the links it handles. Using this field, you can specify which links should be highlighted and exclude the rest.
For example, assuming you have various links that scroll the page (e.g. menu links, back-to-top etc.) and you want only the menu links to get highlighted, you could insert:
.menu-item a[href*='#']

Classes & highlight options

The plugin adds special classes to the links and the target elements it handles when the following happen:

  • When a link is clicked, it gets the mPS2id-clicked class.
    You can change this class name to your own and you can use it in your CSS to style the clicked link. For instance:
    .mPS2id-clicked{ background: #ff0; }
  • When a link’s target element is within the viewport (i.e. visible on the screen), the link gets the mPS2id-highlight class and the target element gets the mPS2id-target class.
    You can change these class names to your own and you can use them in your CSS to style the highlighted link and target. For instance:
    .mPS2id-target{ background: #ff0; }
    a.mPS2id-highlight{ background: #ff0; }

In addition, the plugin will add the above highlight classes with the -first and -last suffix (e.g. mPS2id-highlight-first, mPS2id-highlight-last) in order to differentiate multiple highlighted elements. This is useful when you need to style only the first or last of the highlighted links or targets in your CSS.
For example, if multiple links are highlighted at the same time, instead of using .mPS2id-highlight in your stylesheet, you could do:
a.mPS2id-highlight-first{ background: #ff0; }

An alternative way of restricting highlight to a single link/target and prevent multiple elements from being highlighted at the same time, is to enable Allow only one highlighted element at a time.

There are times when you need to keep at least one element (e.g. a menu link) always highlighted. Enable Keep the current element highlighted until the next one comes into view option if you need such functionality/behavior and your template/page is laid out in a way that at certain scrolling points there are no target sections visible on the screen (no links highlighted).

Enable Highlight by next target option when your target elements have zero height/width to improve highlighting behavior. This option is useful when you add id targets in your content via plugin’s buttons or the [ps2id id='some-id'/] shortcode, as it extends the scrolling range at which an element stays highlighted.

Disable plugin below

Set the viewport/screen-size in pixels, below which the plugin will be disabled. The value can be width or width,height.
For example, insert 1024 to disable plugin’s functionality when the viewport/window width is 1024 pixels or less. Insert 1024,600 to disable plugin when viewport width is 1024 pixels or less and viewport height is 600 pixels or less.
Please note that the values entered will match CSS media queries.

Leaving the field value empty or 0 (default) disables the option.


Check Display widgets id attribute in order to show the id attribute of each widget in Appearance → Widgets. This is a convenient way of finding existing id values in order to use them as links targets.
You can also create your own id targets in widgets via the “Page scroll to id target” widget.

Enable insert link/target buttons in post visual editor activates plugin’s buttons in WordPress visual editor toolbar. You can use these buttons to insert links and id targets in your content.

Advanced options

If another plugin or a theme script handles page scrolling and conflicts with “Page scroll to id”, try enabling Prevent other scripts from handling plugin’s links option. This option attempts to remove (on-the-fly) javascript click events by other scripts from the links. Please note that this might not work on some themes or plugins, as it depends on the way those scripts are attaching the link events.

Enable Normalize anchor-point targets to normalize/reset the CSS properties (height, line-height, border etc.) of anchor-point targets.

wp-config options

define('PS2ID_MINIFIED_JS', false);
Use the PS2ID_MINIFIED_JS constant (permanent global variable) in wp-config.php to select which script files will be loaded on the front-end by the plugin. Adding the above in wp-config.php instructs the plugin to load the non-minified/development version of its scripts.

Divi WordPress Theme Monarch Social Sharing Plugin

Plugin shortcodes

Plugin’s [ps2id] shortcode can be inserted directly in WordPress post editor (as with any WordPress shortcode) in order to create links and id targets in your content.

[ps2id url='#some-id']link text[/ps2id]


  • url (required) – Link URL
    [ps2id url='#some-id']link text[/ps2id]
    [ps2id url='']link text[/ps2id]
    [ps2id url='/page/#some-id']link text[/ps2id]
  • offset (optional) – Link-specific offset (bypasses the general offset value in plugin settings)
    Offset scrolling by 100 pixels
    [ps2id url='#some-id' offset='100']link text[/ps2id]
    Offset scrolling by the height (or width for horizontal layout) of the element with id navigation-menu
    [ps2id url='#some-id' offset='#navigation-menu']link text[/ps2id]
    Offset vertical scrolling by 100 pixels and horizontal scrolling by 50 pixels
    [ps2id url='#some-id' offset='{"y":"100","x":"50"}']link text[/ps2id]
  • class (optional) – Link custom class(es)
    You can give the link one or more custom classes (separate multiple classes with space).
    [ps2id url='#some-id' class='class-a']link text[/ps2id]
    [ps2id url='#some-id' class='class-a class-b']link text[/ps2id]

    You can change the scroll duration/speed of the link (bypass the general scroll duration value in plugin settings) by adding a special class in the form of ps2id-speed-VALUE (i.e. ps2id-speed-600) with VALUE indicating the scroll duration in milliseconds (lower duration equals faster scrolling).

    [ps2id url='#some-id' class='ps2id-speed-400']link text[/ps2id]
    [ps2id url='#some-id' class='ps2id-speed-1300 class-a class-b']link text[/ps2id]

Target id shortcode

There are 2 target shortcodes:

1. Anchor-point target

[ps2id id='some-id'/]

2. Wrapper target

[ps2id_wrap id='some-id']
your content...

You can use the wrapper target ([ps2id_wrap]) when you need to wrap content in a target id (same as adding an id attribute to some content). Doing this gives you better control over the highlighting of associated links.
In addition, wrapper target allows you to include other shortcodes within its content, e.g.

[ps2id_wrap id='some-id']
content... [ps2id url='#another-id']link text[/ps2id] 
more content...
[ps2id id='another-id'/]


  • id (required) – Target id
    [ps2id id='some-id'/]
    [ps2id_wrap id='some-id'] your content... [/ps2id_wrap]
  • target (optional) – The element that’ll be considered as the actual target for highlighting
    This can be useful when you need better highlighting for target elements that have zero dimensions.
    The associated link will scroll to #some-id element but will be highlighted as if its target is the next adjacent div (the div immediately following #some-id element)
    [ps2id id='some-id' target='#some-id + div'/]
    The associated link will scroll to #some-id element but will be highlighted according to #another-id element
    [ps2id id='some-id' target='#another-id'/]

Previous versions

Development version:

Pages: 1 2


Post a comment

Comments pages: 1 2 3

  1. Alessandro
    Posted on February 13, 2018 at 19:23 Permalink

    Hi, first of all, good plugin thank you for this.
    So, I’ve set some anchor in my one-page web site When i go to home page and click on menu ono to one it is all right, but if a select fast the last module on menu ( on bottom page) plugin scroll till the module before then i have to click another time on the same menu voice to arrive to destination. This apperas if I go into a article ( offers) then i click on contatti (the last voice of menu), plugin return into home page and scroll till module before contatti and i have to click newly on menu to set line correctly…
    there is a solution of this?
    thank you in advance

    • Alessandro
      Posted on February 13, 2018 at 19:25 Permalink

      sorry domain is this

    • malihu
      Posted on February 14, 2018 at 01:38 Permalink


      First, you have a page error that prevents most scripts from working. The error I get in developer tools console is:

      Uncaught SyntaxError: Unexpected token <

      which comes from this line of code in your index file:

      /* */</script> <script type='text/javascript'><script type="text/javascript"> some js code here... </script> </script>

      This said, the issue you describe comes from the fact that you have some images in your page that are loaded after the page is scrolled to their position. This type of functionality is called lazy-loading and it always conflicts with in-page anchors and scrolling navigation.

      The problem is that these images (that are lazy-loaded) don’t have a fixed height set, so when they load, they increase the overall height of the document, thus changing the position of your targets that sit at the bottom of the page. This happens while the page is scrolling.

      This is a little technical so to give you an example, it’s like driving a car to a town 50km away but by the time you drive 50km, another 20km of road was just built. So now, you need to drive another 20km to reach your actual destination (i.e. the town). That’s why you need to click 2 times to reach the correct position (i.e. the id target).

      I hope all this makes sense.

      Note that lazy-loading images will have this same problem even if you don’t use “Page scroll to id” plugin.

      The only solution for this is either set a fixed width/height for your lazy-loading images placeholder or remove the lazy-loading images functionality.

      • Alessandro
        Posted on February 14, 2018 at 18:04 Permalink

        Thank you for your assistance, you are very professional.
        I cut-off lazy load from imageand all work fine on home page though from internal page ( offerte) to home page problem remains. So I have set delay for scrolling to 3000 millisecond to give at page time to load correctly and then all works fine.
        Thank you for all,
        very god plugin.


        • malihu
          Posted on February 14, 2018 at 23:56 Permalink

          Thanks, you’re welcome 🙂

          You can probably try to lower the delay if you want. I’d start at about 300 milliseconds and increase it if needed.

          Glad I helped.

  2. Paul
    Posted on February 4, 2018 at 09:01 Permalink

    I cant See Post ToolBar Button in Visual Editor Please tell me how to Fix?

    • malihu
      Posted on February 4, 2018 at 11:15 Permalink

      If you’re using page builder (like Divi builder) you won’t see plugin’s toolbar buttons because these builders do not allow third party buttons in the editor.

      In such case, just use plugin’s shortcodes directly in the editor. The toolbar buttons and shortcodes do exactly the same thing.

  3. Paul
    Posted on February 4, 2018 at 08:58 Permalink

    Am Not Getting Post Scroll to id button on Post Tabs. How to solve?

  4. Marco
    Posted on January 30, 2018 at 20:12 Permalink

    Hi, how I can use the Plugin on a Button/Image and
    after click this Button/Images scroll down to an
    anchor on the same page, please!???
    Thank you very much…

    • malihu
      Posted on January 31, 2018 at 08:51 Permalink

      The quickest way is to go to plugin settings and change the “Selector(s)” option value to:


      Save changes.

      Then go to your page/post editor and create your normal image button and make it a link that points to your target (e.g. give it a URL #your-target-id).

      Another way would be to use plugin’s toolbar button or shortcode to create your link (see tutorial).

      After you create the link, you could style it (e.g. add a background image, color, size etc.) in your CSS (e.g. via WordPress additional CSS).

      • Marco
        Posted on January 31, 2018 at 18:07 Permalink

        Thank you! That was help me.

        I solved it via your Selector(s) Code and:
        1 – add to the Button: #sample-ID
        2 – add to the Anchor Position:

        All the Best!

        • Marco
          Posted on January 31, 2018 at 18:08 Permalink

          2 – add to the Anchor Position:
          <a id="sample-ID"></a>

  5. MandM
    Posted on January 28, 2018 at 04:43 Permalink

    Possible to scroll the pages of a report /document from right to left?
    I’m new to plugins & building website. Sorry if this is not a good question. Thank you

    • malihu
      Posted on January 29, 2018 at 11:31 Permalink

      The plugin works on any direction as long as your page layout is horizontal. You can get an idea by viewing the source HTML of the horizontal demo.

      Please note the the plugin does not scroll overflowed elements (e.g. divs having their own inner scrollbar). It works by scrolling the actual page, so you need to make sure your theme/layout is such.

  6. joe z
    Posted on January 22, 2018 at 21:46 Permalink

    I have a question. Can you put more then 1 selector in the offset field> for exampe: #masthead and .mob-menu together. I am using to 2 menu’s together when it goes mobile. Is that possibl?

  7. Herbert von Kaufmann
    Posted on January 21, 2018 at 00:56 Permalink

    Great plugin, just one question:

    I implemented one page anchor scrolling with your plugin as follows:
    in each row i want to address I add a text element, with no text, but with your target short code (i.e. [ps2id id=’section-2′ target=’section-2 + div’/])
    I am using buttons allocated to the left of the page to address the sections (each button gets the url with the specfic section, i.e. #section-2)
    Now the following issue: when scrolling down (mousewheel) I want to have the button lighlighted, which belongs (addresses) the section. Despite passing the different sections, this does not happen (despite the above advanced short code), is there any way to get that worked?


    • malihu
      Posted on January 21, 2018 at 23:52 Permalink


      I’d need to see your page in order to help and provide an exact solution. Can you post your url?

      • ValleReD
        Posted on January 27, 2018 at 00:39 Permalink

        a bit more specified:

        Scrolling the page NOT Clicking the left buttons (which are using your Plugin) should have the following effect: Button/Link is highlighted, which refers to the section one is currently passing, and when reaching the next section, the button should not be highlighted anymoren, instead the next button when

        • malihu
          Posted on January 29, 2018 at 11:17 Permalink

          You have enabled a couple of options that prevent highlighting from working properly on your layout:

          1)Allow only one highlighted element at a time
          2)Keep the current element highlighted until the next one comes into view
          3)Highlight by next target

          You should normally disable these options and use plugin’s highlight class(es) in your CSS.

  8. Dan Becker
    Posted on January 11, 2018 at 18:11 Permalink

    The following page has some Page Scroll functions on the 6 circular buttons at the top of the page. The also work on the text labels below the circular buttons. These link to various anchor points further down the page. It works fine on desktop, but only the first button (Inspiration) works on mobiles. The others do not do anything.

    Please can you help fix this so it works on mobiles too.


    • malihu
      Posted on January 12, 2018 at 16:02 Permalink

      Firstly, you need to enable the plugin on your icon and text links.
      The easiest/quickest way to do this, is going to “Page scroll to id” settings and change the “Selector(s)” option value to:


      Hit save changes.

      After you do this, test your links (on desktop) and you’ll see the page scroll smoothly to the targets.

      The links do not work on mobile viewports because the elements that contain the targets are hidden via CSS. The hidden elements seem to be the sections images. These are hidden on mobile and the thing is that browsers do not scroll to hidden targets.

      You should move the targets outside of those elements and place them on the sections titles for example.

      FYI: The stylesheet that hides the elements on mobile is:


      and the CSS rule is:

      .vc_hidden-xs { display: none!important; }

      Hope this helps

  9. Sebastian
    Posted on January 10, 2018 at 14:46 Permalink

    the plugin does not work. if I’m outside of a page which is linked with anchors points it works … the page is loaded then I scroll to the point I would like but if I drive within the page another point, the page reloaded.
    I have the plugin on about 5 pages active on no other side is the function as now …

    • malihu
      Posted on January 10, 2018 at 15:08 Permalink

      Make sure your links URL matches exactly your site’s URL (the URL you see in browser’s address bar). For example, if you use the full URL in your links make sure it matches the www, https parts (if these exist).

      If you post your page/website URL I’d be able to see what happens and provide an exact solution, otherwise I can’t really help.

      • sebastian
        Posted on January 11, 2018 at 10:58 Permalink

        this site here:

        the url is: for the points

        i have no idea what to do…

        • Sebastian
          Posted on January 11, 2018 at 11:07 Permalink

          the menu links are here:
          Methode nach dr bach > dr bach strategie > all the links

          ive seen that they not become the tag “data-ps2id-api=”true””

          maybe an js error ?

      • Sebastian
        Posted on January 11, 2018 at 12:20 Permalink

        ok ive fixed that ive change the href to anchorpoint only when iam on current page

        • malihu
          Posted on January 11, 2018 at 15:43 Permalink

          Ok. Your links URL are not correct.

          For example, the link “Wiederherstellungsstrategie” is:


          but this URL does not exist. The link URL should be:


          You should remove the therapie-nach-dr-bach dir from your links. If you do this, you won’t have to change the href on the current page.

          • Sebastian
            Posted on January 12, 2018 at 12:10 Permalink

            oh okay i didnt have seen this, sorry…

            now it works thanks 🙂

  10. Rowan
    Posted on January 5, 2018 at 18:42 Permalink

    I have a custom menu url with #samenstellen, which directs me to that certain page id anchor. which works perfectly when I’m on that page and click the menu item with #samenstellen. However when I’m on a different page lets say /contact, and I press the menu item #samenstellen. It doesn’t go to the page, nor does it go to the page section.

    How can I fix it so, that when even on a different page. It still directs myself to that page and id where its supposed to go.

    • malihu
      Posted on January 6, 2018 at 00:33 Permalink

      Use the full URL in your link. For example, instead of just #samenstellen, use:

  11. Basti
    Posted on January 4, 2018 at 17:20 Permalink

    Hey mahilu,

    thx for this easy-to-use plugin!! 😉

    just one question though…
    setting the offset to a selector or a specific value doesn’t change anything.
    do you have an idea, why this is happening?

    i’m using a floating header, but neither using the header’s height in the plugin’s offset function, nor its id will cause the scrolling to stop any sooner…

    thanks in advance and keep up the good work!



    • malihu
      Posted on January 5, 2018 at 10:07 Permalink


      There’s a chance that your theme has its own function for scrolling the page and handling page anchor links. You can try enabling “Prevent other scripts from handling plugin’s links” option in plugin settings and see if it fixes the issue.

      It’s impossible to say what exactly happens though unless I see your page. If you can post your URL (so I could go and check it), I’d be able to provide an exact solution.

      • Basti
        Posted on January 7, 2018 at 22:42 Permalink

        The preventing option did it!! Thank you!

        If anything comes up again, I will let you know 😉

        Take care.

  12. Tariq
    Posted on December 20, 2017 at 04:48 Permalink

    When I use a button in a widget I have it doesn’t scroll. Is there a special way to have the code apply to buttons btn?

    • malihu
      Posted on December 21, 2017 at 14:25 Permalink

      You can enable the plugin on all links with a hash in their URL (including widget links) by doing the following:

      Go to plugin settings and change “Selector(s)” option value to:


      Save changes and test your button(s).

  13. Luis
    Posted on December 19, 2017 at 22:13 Permalink

    Hello, I followed your video tutorial and it still does not work for me. When I click on a menu item, it does not scroll to the position but I do see URL change at the the end to /#section-1.

    The “Enable on WordPress menu links” options is clicked. I also added the special css class ‘ps2id’ to the CSS classes and I also tried to add the ‘m_PageScroll2id’ to the Link Relation (XFN) option and it still does nothing. Can you help me please?

    P.S – I have not changed the default options that come when the plugin is installed.

    • malihu
      Posted on December 21, 2017 at 14:35 Permalink


      You don’t have any targets in your content. Did you create the targets that your links should scroll to?

      For example, you have a link (“Lease to Own”) with URL #section-2 but you don’t have a target element with id section-2

      You need to create the targets (see tutorial).

  14. Alan
    Posted on December 16, 2017 at 15:43 Permalink

    Is it possible to have an offset for desktop versions and another offset for mobile versions based on a displays height and/or width?



    • Alan
      Posted on December 16, 2017 at 15:52 Permalink

      I solved this issue by using the #masthead selector

  15. J King
    Posted on December 7, 2017 at 19:58 Permalink

    PAGE SCROLL TO ID is awesome. Works like a charm for what I need. One question though…

    The site is:

    I have it set up with my MENU links to go to different parts o f a page. I’m using the ‘wrapper code’ provided:

    [ps2id_wrap id=’some-id’]
    your content…

    BUT it does NOT work at all if you are NOT already on the SAME MENU tab. For example – if Im on the “Reasons To Invest” menu tab and want to go to “Our Technology” – which is under the “Opportunity To Grow” menu tab- you must first click on the “Opportunity To Grow” tab.

    Please let me know if this can be fixed and how.

    Thanks !

    • malihu
      Posted on December 8, 2017 at 00:57 Permalink


      You simply need to add the full address as your links URL/href value instead of just the hash with the id (see this FAQ).

      For example, change the “Crunching The Numbers” link URL from:



      Likewise, “6 Steps To Ownership” from:



      and so on…

  16. Tomas Risberg
    Posted on December 7, 2017 at 16:23 Permalink


    Thank you so much for Page scroll to id. Sridhar Katakam helped me to make it work with the anchor links that the Zotpress plugin creates. I use Zotpress for scientific writing purposes. It handles references.

    I wonder if it would be possible to add some code to Page scroll to id for to create a so called “back-to-where-I-where arrow” from the reference list that Zotpress creates. If you click on an in-text citation in my pages you will now be slowly scrolled to the bottom, but you might then find it difficult to go back to where you were.

    It would be perfect to have a back-to-where-I-where arrow that is presented below the figure of the actual reference in the reference list. Do you think that would be possible?

    Tomas Risberg

    • malihu
      Posted on December 7, 2017 at 18:33 Permalink


      There are 2 basic ways to do this:

      1)Enable “Append the clicked link’s hash value to browser’s URL/address bar” option in plugin settings. This way you can use the browser’s back button to go back to where you were before clicking the link.

      You can also create a link that goes back one browser history step:

      <a href="javascript:history.back()">Back</a>

      2)Create an additional target before each reference link. Then, create a “Go back” link below each reference paragraph that points to the target you created. For example:

      But why do then some robots benefit of sleep [ps2id id='back-to-3'/] [3]?

      3. …Neurophysiol Clin. 2004 Apr;34(2):59–70. [ps2id url='#back-to-3']Back[/ps2id]

      • Tomas Risberg
        Posted on December 8, 2017 at 22:53 Permalink

        Thank you so much. I will contact the developer of Zotpress and ask if she wants to add support for this in the plugin.

  17. Ciska
    Posted on November 28, 2017 at 18:16 Permalink

    I have been using this plugin for some time without hassles. Recently changed my theme and now I have a problem using this from the WordPress menu.

    Your instructions above says “Click to edit each one of the links you’ve created and insert the ps2id value in “CSS Classes” field”

    Now I’m not too technical so help me with the ps2id and the text I have to add here. If my id is named #Travel, is this what I add to that CSS field?

    If I open my use my menu to go to one of these pages, it opens on that spot on the page but jumps right back to the top of the page again. I don’t think it sees my ps2id

    Some help will be appreciated

  18. Tomasz
    Posted on November 28, 2017 at 09:38 Permalink


    Could You hellp me with adding to menu item to scroll to contact widget on the bottom of the page?
    Thank You in advance.
    Best regards

    • malihu
      Posted on November 28, 2017 at 17:00 Permalink

      Give your link the URL:

      You should be able to see the id of any widget in Appearance > Widgets, so you can use this id as the target.


Comments pages: 1 2 3

Post a comment

Your e-mail is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
You can write or copy/paste code directly in your comment using the <code> tag:
<code>code here...</code>
You may also use the data-lang attribute to determine the code language like so:
<code data-lang-html>, <code data-lang-css>, <code data-lang-js> and <code data-lang-php>