Page scroll to id for WordPress tutorial
Basic tutorial for using “Page scroll to id” WordPress plugin on your WordPress site.
- Creating id targets
- Creating links
- Links highlighting
- Offset scrolling for sticky menus
- Scrolling from/to different pages
- Video tutorial
In order to use the plugin on your WordPress site (after installing and activating it), you need to do the following:
- Create id targets the page will scroll to or find existing id attributes in your theme to use with your links.
- Create links that point to those targets or enable the plugin on links that already exist in your site.
Creating id targets
Creating id targets in post block editor (Gutenberg)
You can create your targets in more than one ways in the block editor, e.g. using the group block, the “Page scroll to id target” block, the shortcode block, block class attribute, HTML anchor field etc.
Create id targets using the group block
Click on the “Add block” icon and select “Group”. This will insert a general container block that can group other blocks and we can add the id
on this group/general container block.
On the group block properties (right panel) you can add the id you want in the “HTML Anchor” field.
Create id targets using the “HTML Anchor” field
If you use headings in your content, you can use the “HTML Anchor” attribute of blocks to set a target id. Select your block, click “Advanced” in the right panel and insert the target id you want in the “HTML Anchor” field.
Create id targets using plugin’s “Page scroll to id target” block
The plugin has its own custom block for inserting targets: “Page scroll to id target”
Create id targets using “Additional CSS Class(es)” field
You can generate id targets for any block element, by setting its class name to: ps2id-id-yourid
, changing the yourid
part to the id value you want.
Click on a block element (e.g. a paragraph), click “Advanced” in the right panel and set the target id you want in the “Additional CSS Class” in the form of:
ps2id-id-
plus the id you want.
For example, if you want to create the target id “last-section”, give the element the CSS class:
ps2id-id-last-section
.
Create id targets using the shortcode block
You can use plugin’s shortcodes in the block editor. Click on the “Add block” icon and select “Shortcode”.
Add the [ps2id id='section-1'/]
in the shortcode field to create a target with id section-1
.
You can also use the [ps2id_wrap]
shortcode accordingly.
Creating id targets in post visual editor (classic “old” editor)
In post visual editor, click the toolbar button “Insert Page scroll to id target” to create a target at the cursor position in the editor.
In “Page scroll to id target” modal insert the id value you want (e.g. some-id
) and click “OK”. The target shortcode (e.g. [ps2id id='some-id' target=''/]
) will appear in the editor. Update/save the post/page. You can now use this id value in your link(s) URL (e.g. #some-id
).
Creating id targets in post editor via shortcodes
In post visual or text editor, enter [ps2id id='some-id'/]
in the place you want to create the target and set the id
attribute to the value you want. This will create a simple anchor-point target. If you want to wrap your content (or part of your content) in a target id (same as adding an id attribute to some content), use the [ps2id_wrap]
shortcode:
[ps2id_wrap id='some-id'] your content... [/ps2id_wrap]
Update/save the post/page so you can use this target value in your link(s) URL (e.g. #some-id
).
Click here for more info on target shortcodes
Creating id targets in HTML
Wrap your content in a div with an id attribute (recommended for better link highlighting) or add simple anchor points (with id attributes) before each content section. Examples:
<div id="section-1"> <p>Section 1 content...</p> </div> <div id="section-2"> <p>Section 2 content...</p> </div> <div id="section-3"> <p>Section 3 content...</p> </div>
<a id="section-1"></a> <p>Section 1 content...</p> <a id="section-2"></a> <p>Section 2 content...</p> <a id="section-3"></a> <p>Section 3 content...</p>
Creating id targets in WordPress widget areas
Create targets in your widget areas (Appearance → Widgets) via plugin’s “Page scroll to id target” widget.
Keep in mind that all WordPress widgets have existing id values that you can use with your links. You can find these id values within each active widget under “Page scroll to id target” label. The option to display these values is “Display widgets id attribute” which is enabled by default.
FAQ
Creating links
Creating links in WordPress Menus
Edit your menu and add “Custom links” as these type of links allow us to enter a custom URL with the id we want. Your links URL should be in the form of #some-id
, http://my-site.com/page/#some-id
, /page/#some-id
etc.
Please note that if you want your links to work from other/different pages, you’ll need to insert the full address with the target id in their URL (e.g. http://my-site.com/page/#some-id
) or the relative-root URL (e.g. /page/#some-id
).
Creating links in post block editor (Gutenberg)
You can use plugin’s shortcodes in the block editor. Add the shortcode: [ps2id url='#some-id']link text[/ps2id]
inside any block element to create a link that points to the “some-id” target.
Keep in mind that since “Page scroll to id” version 1.6.3, the plugin is enabled by default on all links with a non-empty hash value (e.g. #some-id
) in their URL. This means that you don’t have to use plugin’s shortcode to create links, as any link you create via the WordPress editor will work.
Creating links in post visual editor (classic editor)
In post visual editor, click the toolbar button “Insert/edit Page scroll to id link” to create a link at the cursor position in the editor or from text you’ve already selected.
#some-id
, http://my-site.com/page/#some-id
, /page/#some-id
etc. When ready, click “OK” and the link will appear in the editor. You can edit the link via both “Insert/edit link” and “Insert/edit Page scroll to id link” buttons, as well as inline.
“Page scroll to id link” modal provides additional options like “Offset” and “Custom class(es)” that can be used to change link’s offset, its scroll duration/speed etc.
Creating links in post editor via shortcodes
In post visual or text editor, enter [ps2id url='#some-id']link text[/ps2id]
in the place you want to create the link and set the url
attribute and link’s text to the values you want. The shortcode provides the same options as plugin’s “Insert/edit Page scroll to id link” toolbar button via attributes.
Creating links manually
Any link with ps2id
class or m_PageScroll2id
rel attribute value will be handled by the plugin. For example:
<a href="#some-id" class="ps2id">link text</a> <a href="#another-id" rel="m_PageScroll2id">link text</a>
Enabling the plugin on links that already exist in your site
You can instruct “Page scroll to id” to handle any link in your page(s) by using the “Selector(s)” field in plugin settings.
If you need to enable “Page scroll to id” on all links with URL containing a hash (#
), insert the following value in “Selector(s)” field:
a[href*=#]:not([href=#])
Click here for more info on “Selector(s)”
FAQ
- How do I make my links work from any page in my site?
- Can I have links with different offsets?
- How to make the plugin work with WordPress Menu links?
- Can I have links with different scroll duration/speed?
Links highlighting
Each time a target element is visible on the screen (i.e. is within the viewport), the plugin adds the mPS2id-highlight
class to its associated link or links (i.e. the links that scroll to this target). You can use this class in your theme’s stylesheet or custom CSS to style the current/active link(s), e.g.
a.mPS2id-highlight{ background: #ff0; }
Common case scenario and example
Lets say you have a sticky menu containing links that scroll to various targets/sections within the page. Your links text color is black (which may be set by your theme or some other stylesheet):
.memu-item a{ color: black; }
When scrolling through page sections (i.e. targets) you want the link of the visible/current target to become red. You can do this by adding the following CSS:
.memu-item a.mPS2id-highlight{ color: red; }
Notes and more info
The default highlight classes for the links are: mPS2id-highlight
, mPS2id-highlight-first
and mPS2id-highlight-last
(you can change these class-names in plugin’s settings if you want).
For more information about the highlight classes and options see “Classes & highlight options”, “Highlight selector(s)” and FAQ below.
FAQ
- How do I make my links stay highlighted for longer distance while scrolling?
- Multiple links get highlighted! How to highlight only one?
Offset scrolling for sticky menus
If your page has a top sticky/fixed-positioned menu, you’ll probably need to use plugin’s “Offset” option in order to prevent the menu from overlapping your content. This option allows us to shift (i.e. offset) scrolling, so in the case of a top sticky menu, we usually need to “stop” scrolling a few pixels before the target reaches the top of the page (to accommodate for the space the sticky menu occupies).
Go to Settings → Page scroll to id → Offset and insert an offset amount equal to your sticky menu height (in pixels). You can insert its height value as a number (e.g. 100
) or you can insert your menu selector (e.g. #my-sticky-menu
), so the plugin calculates its height automatically.
The plugin provides special selector expressions in order to define advanced offsets and work with responsive menus. For more info see “Offset” option.
Scrolling from/to different pages
The plugin has the option to scroll from/to different pages enabled by default. This means that when you click a link which points to a target id on another page, you’ll still get the smooth scrolling effect which will happen immediately after that page is fully loaded.
The only thing you’ll need is to make sure your links have the full address with the target id in their URL (e.g. http://my-site.com/page/#some-id
).
Hello, I need help cause in my case I don’t find scrolling smoothly. When I click our service submenu and when it’s scrolling then it does not feel smooth it looks like the hitch. Please guide me how can I make this smoothly. Thanks
Hi,
I checked your page and it does not use “Page scroll to id” plugin, so I don’t know how to help(?)
Hi there, I’ve got the page scrolling from the menu bar links to down on the page just fine… the menu bar floats, and when I click “home” from further down the page, it doesn’t scroll up, it goes to the top of the page and makes a slight down scroll movement. Is it possible to scroll back up from a lower position to the top so it looks fluid?
Thanks
Nevermind, it’s working now!
Hello,
Could You help me with adding the blog page in the menu to scroll?
on my website the blog page is news
Thank You in advance
Hi,
Your “News” section has the id
panel3
, so you can create a custom link in your menu with URL:#panel3
This link will scroll to the news section (including the section large image).
Thank You for Your quick answer.
Is it possible to make it to scroll a little bit lower to the nwes not to the photo?
If i will change in offset it will change in all pages but i only want to change it in News section.
Could You tell me, do You know how to change the backgrounf color in menu in mobile version?
Thank You in advance
You will need to add an id target on the “NEWS” title element but I’m not sure if your theme provides a way to do this without editing your template.
Personally, I would just remove the news section heading image as it doesn’t add anything important to the user.
To change the menu style for the mobile, you could add something like the following CSS:
@media screen and (max-width: 48em){ .navigation-top, .main-navigation ul{ background: #ddd; color: #000; } }
Thank You for Your help,
i have deleted the photo You are right that this is not neccessary.
Thank You for the background color help.
Best regards and have a nice evening
One more question,
What should i add to css to change the highlight when i am on for example contact?
You’re welcome.
To highlight your menu links, you can use something like:
.navigation-top .current-menu-item > a.mPS2id-highlight, .navigation-top .current_page_item > a.mPS2id-highlight { color: yellow; }
See more info about the highlight classes here.
“Insert Page scroll to id target” button is not showing on mine.
I already downloaded and activated the plugin.
I’m at the “edit page” and it seems “Insert Page scroll to id target” button needs to be next to the “toolbar toggle” button, but I don’t see it.
How can I make it be shown?
Do you use a page builder plugin or tinymce advanced?
I have the same problem and I use page builder i tinymce. What can I do?
You can use plugin’s shortcodes.
hmm I tried this option but still it doesn’t work. I’m not sure that I put shortcodes at good place. do you have any video tutiorial or tutorial step by step how can I do this?
WordPress shortcodes are inserted inside the content editor (any content editor you use, e.g. page builder text block, native wp visual editor etc.).
An alternative is to enable the plugin to handle all in-page links in your theme and content.
Go to “Page scroll to id” settings, change the “Selector(s)” option to:
a[href*=#]:not([href=#])
and save changes.
If you do this, the plugin will handle any link with a hash (.i.e.
#
) in its URL, so you can insert standard/normal links in your editor without the need to use “Page scroll to id” buttons or shortcodes.It’s work! thank you so much! 🙂
Hello,
i have installed your Plugin on my page and i did everything right with the custom links in the menu as subitems.
It works perfect on one site, the slide was perfect and smooth but then i wanted to do the same again on another site and i did everything exact the same way but now it don’t scroll to this id it just jumped.
I don’t know what i did different or wrong. I really tried to do exactly the same.
my website is http://bimpro.eu
where it works perfectly: http://bimpro.eu/bimpro/
and where it don’t works for example: http://bimpro.eu/bim/
i hope you can help me and thank you 🙂
Hi,
The plugin is not enabled on your menu links. This probably happens because the theme prevents “Page scroll to id” from being enabled on the menu items automatically.
The links at
bimpro.eu/bimpro/
scroll the page via another script that for some reason it doesn’t apply onbimpro.eu/bim/
The easiest solution is to enable “Page scroll to id” on your links manually.
Got to plugin settings and change “Selector(s)” option value to:
a[href*=#]:not([href=#])
Save changes and test your pages 😉
Hi,
I´m having trouble “anchoring” the elements to a menu in a theme since the existing anchors have no name, only ´#´. Can you give me a hint or pointers as how I´m able to use the plugin to create the menu from these anchors?
Thanks and Regards,
Bjoern
Hello,
You will not be able to use the plugin (or any similar plugin) with the way your theme works.
Your theme does not scroll the actual document. It has an internal js script that switches between the sections with a custom javascript function (that’s why there are no id attributes). It basically changes the sections top position programmatically (i.e. it does not scroll the page).
Even without “Page scroll to id”, you cannot “jump” to any id target because the page has no scrollbar and all sections have the same height as the viewport (i.e. there’s nowhere to scroll to).
You should probably contact the theme developer and ask if there’s a way to do what you describe. The only other solution is to write your own custom javascript (on top of the theme’s function).
Hi there. Thanks for making such a great plugin!
Just wanted to ask about allowing the plugin to work on a pre-made button. I am trying to get the “FIND OUT MORE” button on my home page to scroll down but everytime I click it, it scrolls down and then refreshes the page.
The button was created using Page Builder by SiteOrigin Plugin with SiteOrigin Widgets Bundle. I have added in the rel=m_PageScroll2id to the button through the Page Builder interface
If I untick the “Prevent other scripts from handling plugin’s links (if possible)” option, the button will just jump to the id instead.
Hello,
The plugin works fine on the button. The problem is the link of the slide, which is added on the parent
li
element.The script that’s adding the slide link is:
...plugins/so-widgets-bundle/js/slider/jquery.slider.min.js
When you click anywhere inside the “Giving Hope…” slide, the above script reloads the page.
Have you added a link on this slide? Can you remove it?
Just removed it and it totally fixed the problem! Thank you so much! Would have never realised it without you.
Just wanted to add. I can’t seem to get the button working if i use the method that is suppose to work for external links. When i try adding
a[href*=#]:not([href=#])
or
a[href=’#mission’]
into the selectors field it doesn’t seem to work for that same button. That is why i had to get the button working by adding the rel into it.
Was just wondering if it was something i was doing wrong or if it is an issue with the javascript (maybe?)
It should definitely work.
Can you try it again?
a)Remove the rel value
b)Go to plugin settings and change “Selector(s)” option to:
a[href*=#]:not([href=#])
Save changes and test the page.
Let me know when you do so I can check it
Hi Thanks for this plugin, I have small problem with this one : If my target is another page custom menu link.
Example :- http://localhost/wordpress/en/#News,
and now i’m in http://localhost/wordpress/page. i want to go home page #News section but link showing http://localhost/wordpress/page/#News. it’s not moving to #News section.
thanks
Hi,
Your link’s URL should be the full address (not just the target id). For example, the link’s URL should be:
http://localhost/wordpress/en/#News
more info
Is this what you need?
Yes thank you, If i mentioned like this my
function special_nav_class ($classes, $item) have issue the active class applying for custom links.
Hi there,
I’ve managed to get the scrolling hashtags and offset and speed to work correctly, but I think I’m messing up the menus — whenever I click a menu item, it re-loads the page and scrolls down to the section from the top, instead of scrolling up or down to the selected section from the section I’m on.
The written instructions say to include the “page” in the Custom Link creation, but the video tutorial doesn’t seem to do that. When I don’t include the page name, the scrolling doesn’t work at all and clicking the links just jumps directly to the section.
Any insight is appreciated,
Thanks.
Hi,
Your menu links URL do not seem to be correct. There’s no
Home
path in your server. Your page URL isamericanaccesscontrols.com/wp/
but your links URL isamericanaccesscontrols.com/wp/Home/
. There’s noHome
page in your site, so remove it from the URL.So for example, change “Products” link from:
/wp/Home/#products
to:
/wp/#products
Also, your theme’s menu prevents “Page scroll to id” from being auto-enabled on its links, so you need to do it manually – see here.
If you do the above, everything will work with or without the page name in your links URL.
Hope this helps
Hi, your plugin it’s amazing. Thanks.
I have a little problem, because everytime that i click on a button, the page goes to top and after this goes to my section.
I saw in your exemple, the other way, without this.
How can i do to have like your exemple?
I need to see your page in order to help. Can you post your URL?
Firstly great plugin Malihu. Gladly donated to reward your skills!
However, i’m having a few problems getting it to work correctly. I read through a lot of comments to try and find someone with a similar problem but…
I’m using the plugin in a menu and also as image links within each section of the page. I get the same problem with both implementations, ie it doesn’t arrive at the start of each section (which starts with a header title). Have used various approaches to try and solve the issue; Link offsets in px values, offset with the menu id, adding stuff to the selector field…etc etc.
As the sections on this scrolling page are classes rather than id’s it’s not possible to target the wrapper that defines each section. ( i believe). Is there any way i can get the plugin to function correctly in this scenario? Or is it a problem with the way my theme (menu) is implemented.
Thanks in advance for any help you can provide. David
Hello,
I just checked your page. Your id targets are correctly set (no need to change them). Your off-menu links (e.g. the arrow image links) are handled by another script in your theme (
...themes/hatch/highgrade/js/app.js
). That’s why offset doesn’t work (the theme script overwrites “Page scroll to id”).Solution
Go to “Page scroll to id” settings and:
1. Set the “Offset” value to:
#hgr_top_navbar_container
That’s your theme’s header id.
2. Enable/check “Prevent other scripts from handling plugin’s links” option under “Advanced options”.
Save changes and test your links. Everything should be working as expected.
Let me know
The main nav works great now. Thanks for your speedy response 🙂
The arrow image links —while working better than before— still only arrive at the first text rather than the beginning of the section even after adding some offset values. (‘test link’ on page). Is this because of the underlying theme app.js file that you mention? If so i’m going to see if i can disable it someway.
Thanks again. Keep up the good work.
Yes, it’s because of the app.js theme file.
Since “Prevent other scripts from handling plugin’s links” option cannot remove the app.js events automatically, you’ll have to do it manually.
Edit
...themes/hatch/highgrade/js/app.js
file and find line 99 (right below the “Scroll nav outside the menu, ex. buttons” comment). Change this line from:jQuery("a[href*='#']:not(ul.main_navbar li.menu-item a[href*='#'], a.back-to-top, a.close-btn, a.fssearch, a.cd-primary-nav-trigger, a.vc_pagination-trigger, .hgracc-title a)").on( "click", function(){
to:
jQuery("a[href*='#']:not(ul.main_navbar li.menu-item a[href*='#'], a._ps2id, a.back-to-top, a.close-btn, a.fssearch, a.cd-primary-nav-trigger, a.vc_pagination-trigger, .hgracc-title a)").on( "click", function(){
This will prevent app.js from handling “Page scroll to id” links (i.e. links with
_ps2id
class ).Save the file and test your links again.
Hello again.
Took your advice and edited the .js file.
It works better but currently it’s not quite getting the amount of scroll right. The page sections are slightly incorrectly offset even after allowing for the sticky menu.
Any suggestions?
Thanks again.
The scroll position seems to differ because the sections have different top padding. For example, “NOTRE VISION” section has 75px padding while “LE PRINCIPE” has 35px.
You also have id targets within content (e.g. in “LE PRINCIPE”) and id targets on the sections themself (e.g. “NOTRE VISION”).
You should add the target id on each section (like in “NOTRE VISION”) and each section top padding should normally be the same.
Hope this helps
Hi Malihu,
Love the plugin! It works great on the mobile menu but I’m having an issue with the sticky nav. When I click on a link in the primary navigation, the page scrolls down but none of the links on the sticky nav get highlighted.
I have tried
Changing the “Selector(s)” field to:
a[rel=’m_PageScroll2id’], .menu-item a[href*=’#’]
a[rel=’m_PageScroll2id’], #primary-menu a[href*=’#’]
Adding “ps2id” class to the link
I think the mobile menu is not allowing the sticky menu to work.
Any help would be greatly appreciated!
– Whitney
http://www.modernhustledesign.co
Hello Whitney,
This happens because you have the option “Allow only one highlighted element at a time” enabled. You’ll need to uncheck/disable this as it restricts highlighting only on one link (in your case the mobile menu one and not the desktop one).
In addition, from viewing your page’s HTML, it seems that you don’t need to create the targets elements:
PORTFOLIO
ABOUT
SERVICES
CONTACT
as your theme already have these target id attributes set.
This means that you also don’t need the option “Keep the current element highlighted until the next one comes into view” checked.
Hope this helps
Works perfect! Thanks so much.
Hi,
In post visual editor, the toolbar button “Insert Page scroll to id target” do not appear.
The extension is install.
Regards
Hi,
Do you use “Page Builder by SiteOrigin” (or something similar)? If yes, they do not allow custom buttons on their widget editor.
You can use plugin’s shortcodes to do the same thing the toolbar buttons do:
Create targets via shortcode
Create links via shortcode
Hi Malihu-
I’ve tried every way (or I think I did) to enable the plugin on my menu links. It is still jumping instead of smooth scrolling.
Things I tried:
– Adding a[rel=’m_PageScroll2id’], .menu-item a[href*=’#’] to Selector(s)
– Adding ps2id to CSS classes in Appearance>Menu
– Enable the “Prevent other scripts from handling plugin links”
Also, I’m not sure if the selector for offset is correct. I used .menu-scroll-page-menu. Is it correct?
Thank you for your help in advance!
Hello,
1. Your offset selector is correct.
2. Your theme seems to be doing its own thing for generating the menu(s). Specifically:
a) It adds the
ps2id
class on the “wrong” element. It doesn’t add the class on the link. It adds it on an inneri
element. This is why the 2nd thing you tried didn’t work.b) The theme does not use the standard
menu-item
class. It only uses the current class and the menu-item-id class. That’s why the 1st thing you tried didn’t work.Basically, you did everything right but the theme kept fighting you back 🙂
Solution
1. Remove the
ps2id
class from the menu items (in Appearance -> Menu) as it’s not needed.2. Go to plugin settings and change the “Selector(s)” to:
a[rel='m_PageScroll2id'], #nav-main a[href*='#']
Save changes and test your page. Everything should be working.
Let me know
Yes, that works amazing! Thank you so much Malihu.
Hello,
I have a multiple pages website, I am using visual composer to edit my pages,
the deal is i want to use page scroll id plugin for one single page & i dont want to use it in the menu instead i want to use it in the buttons on that page
is there a way to do it
Please help
Thanks in Advance
Visual composer allows you to enter an id on any composing block/element you choose (visual composer has an id field for almost all elements).
You can then enable “Page scroll to id” to handle any kind of link by adding:
a[href*=#]:not([href=#])
to “Selector(s)” field in plugin settings. See here for more info.
Hello, friend, your tutorial helps a lot two days onwards my mind is blowing. Thanks a lot.
On the home page of http://www.airpurifiercritic.com/ I have this at the top [ps2id id=’some-id’ target=”/] and this at the bottom Back to Top it is not going to the top of the page what am I doing wrong?
Hello,
You just need to get the developer version of the plugin. Please see this post:
https://wordpress.org/support/topic/uncaught-type-error-as-match-is-not-a-function/#post-8934241
Hey thanks it works great!
Hello, I have a button in a slider. I installed the plugin and created the anchor ID but the action jumps.
This is the code in the slider:
[tx_vslider height=”100″ reduct=”130″ vurl=”https://www.youtube.com/watch?v=oUUvK9WUves&feature=youtu.be” overlay=”vignette” bgurl=”http://lacasadecarton.edu.pe/prev/wp-content/uploads/2017/06/slide04.jpg” attachment=”fixed” bgsize=”cover” imgurl=”http://lacasadecarton.edu.pe/prev/wp-content/uploads/2017/06/3.png” title=”” linktext=”” linkurl=”#1984″]Formamos personas solidarias, buscadoras de verdad, libres y creativas para una sociedad democrática y un mundo ecológicamente viable.[/tx_vslider]
and this is the CSS for the button:
.vslider_button, .vslider_button:visited {
display: inline-block;
height: 48px;
line-height: 48px;
padding: 0px 48px;
color: #FFF;
text-transform: uppercase;
background-color: #333;
opacity: 0.8;
text-decoration: none;
font-family:FontAwesome;
font-size:40px;
}
What is worng?
Thanks for your time!
I saw that you fixed the issue by adding the global selector
a[href*=#]
in “Selector(s)”, correct?Yes my friend, finally I found the solution in an old response of yours! Thanks for your time.
Hallo I use page scroll to id plugin for wordpress but I have a multilanguage site and I can not change the title of the section to the second language. Is there another way to fix this with costum code? Thank you
Hello,
I’m not sure how you translate posts(?) What multilingual plugin are you using and how you create the targets?
Hi there.
Thanks a lot for this plugin.
I wonder if is normal page reloads before scroll to section. I didn’t saw that in your video tutorial.
Do you know what could be the problem? Can you help me?
Thanks in advance.
Regards.
Edited:
I changed the “Selector(s)” field to:
a[rel=’m_PageScroll2id’], .menu-item a[href*=’#’]
but it is the same.
I put class ps2id in “CSS Classes” field at menu but no way.
I tried the option “Prevent other scripts from handling plugin’s links (if possible)” but it seems the same.
Any ideas?
Thanks.
Make sure your links URL matches exactly the URL you see in browser’s address bar (e.g. missing the
www
part or havinghttps
).Hi malihu
Yep, it works! Thanks for your quickly answer!
Regards
Hej Malihu!
Glad that i found your plugin – looks like it’s what i’m looking for a long time.
But – like often, it won’t work like i really want – don’t know if i’m wrong with my work.
Would be great if you could have look here: http://www.faktoffice.com (pw: 1234)
Shortly said: we got five pages – and want to use the horizontal slide effect between the menu-points, that the page feels like “one big canvas”. Would be great if you could have look.
Maybe deeper in the backend (if you want), i really like to donate for your plugin, if it works – because we appreciate a lot.
Best from Berlin,
Hitmilk
Hello Hitmilk,
The “Page layout” option does not transform your theme’s templates layout. In other words, it won’t change your theme/page design from (the standard) vertical to horizontal.
This option simply informs plugin’s script that you want to scroll in a specific direction (vertical, horizontal or both).
Your theme’s layout is currently vertical. You’ll need to either get a horizontal layout theme or create one manually (via CSS). You could use the markup and CSS of the horizontal demo as a basis if you want.
Hope this clarifies what the option does.
I don’t think you’ll be able to find a plugin that turns vertical themes to horizontal, as such layouts are completely depended on theme’s markup, CSS and the content itself.
Hi,
I’ve tried configuring your plugin but it doesn’t seem to be scrolling at all. I’ve tried using the link attribute ‘m_PageScroll2id’ but it just keeps jumping.
I’m trying to get it to scroll to the bottom when you click on ‘contact us’ on the top nav. There is an ID of #enquire in that section. Are you able to tell me if there’s anything wrong?
Thanks
Hello,
The plugin does not seem to be activated in your theme (plugin’s frontend scripts are not included in your HTML).
Is the plugin activated?
Does your theme have
wp_head()
andwp_footer()
functions? These functions are required for the plugin to work (in fact, most plugins won’t work without them).Hi,
I’m trying to change the menu item text colour on scroll instead of highlighting the whole item using your plugin.
i added the bellow css code to my style.css
i have set ps2id at the menu item classes
background: yellow; => works fine
color: red; => not working
a.mPS2id-highlight{
color: red;
background: yellow;
}
Any help would be appreciated.
Regards,
Andreas
Another CSS rule from your theme’s stylesheet is probably overwrites the
a.mPS2id-highlight
color rule you’ve set.You should try making your CSS selector more specific (e.g.
.menu-item a.mPS2id-highlight
is more specific than the one you’ve set). You can read about cascading order and inheritance in CSS here if you want.It’s impossible for me to know what selector to put as I don’t have your site URL in order to check it via browser’s developer tools. If you can post your site link, I’d be happy to help.
Hello!
This used to work perfectly for my site, but suddenly it has quit working and I cannot figure out why.
Example: My page won’t scroll to the link below.
http://www.hillcountryclassicaustin.org/new/#home-section-3 (“Sponsor” in the navigation menu)
Please advise.
Thanks so much!
Kristine
Hi,
It’s not “Page scroll to id”. Have you installed any new plugin(s)?
I opened your site with Chrome developer tools and I get console errors coming from the following script (i.e. “J Shortcodes” plugin):
http://www.hillcountryclassicaustin.org/new/wp-content/plugins/j-shortcodes/galleryview/js/jquery.easing.1.3.js
The “J Shortcodes” plugin produces js errors that prevent other code from working. I don’t think you should use this plugin. It was last updated 4 years ago!
Hi sir !
Great work i am using your plugin for shadow wordpress theme
1)it scroll on same page to section id’s but i am not able to Scrolling from/to different pages
2) we are using sticky header
Please help help us sir
thanks
Thanks bro 😉
My blog is a list of events for the month. I would like to scroll to the current date inside the document automatically on load.
Is this possible?
This cannot be done automatically. The plugin has the ability to scroll programmatically but you’d need to develop a custom js script and call plugin’s scrollTo method on the id of the current date event. You’d need a web developer to do this.
Hello Sir! I love your plugin! Thanks so much for it! Quick question though. If I add menu item that points to, for example #portfolio it does not scroll, it jumps, when I put in the whole site name+#portfolio it reloads the page and then scrolls smoothly. Is there any way to make it work so it scroll without reloading the website?
My website would be: http://www.jagnaniedzielska.pl (actually its my girlfriends site)
Thanks so much! Any help would be appreciated!
The plugin is not enabled on your menu links. See the following FAQ for more info and why this happens:
http://manos.malihu.gr/page-scroll-to-id-for-wordpress/2/#faq-14
The easiest way to enable it is to go to plugin settings and change the “Selector(s)” field to:
a[rel='m_PageScroll2id'], .menu-item a[href*='#']
Click “Save Changes” and test 😉
Hi , thanks for your great plugin, but when i install it , i cant able to see the options in the editor to insert the code
Hi,
Do you mean you can’t see the plugin’s insert link/target buttons in WordPress post/page editor?
If yes, you’re probably using a site builder like “Siteorigin page builder”(?) Some builders do not allow custom buttons in the editor’s toolbar.
You can always use plugin’s shortcodes though. See here:
http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-shortcodes
Hi there –
I have implemented your great plugin on my site, and it seems to be working selectively. I have coded the links the same way on my site, yet only half function.
When selecting a location (Atlantic, Western, Ontario, Quebec) – the anchor just jumps to it’s location. However, when you press Back to Top, it scrolls perfectly.
Any idea on the issue at hand? Thanks in advance.
Hello,
Your target elements (for “ATLANTIC”, “QUEBEC” etc.) do not have id attributes. The elements use the (deprecated) name attribute which will not work with “Page scroll to id”. You need to change the
name
toid
attribute or create the targets via plugin’s button/shortcode.Wow – thanks for catching that. I’m not even sure how the name tag was used.
Works great now. Thanks for the prompt reply, and solution. I’ve been starting at a screen for too long!
Cheers.
You’re welcome 🙂