- This topic has 10 replies, 5 voices, and was last updated 9 years, 2 months ago by
Brent.
-
AuthorPosts
-
September 16, 2015 at 3:54 am #137200
Steven McGregor
When using sections on a page how do you change the section IDs from ‘generate_section-1’ to something meaningful like “products” or “contact”?
Sorry, I couldn’t find the answer anywhere else.
Thanks.
September 16, 2015 at 8:57 am #137288Tom
Lead DeveloperLead DeveloperHmm, interesting – I don’t know if this is possible right now.
Let me look into it 🙂
September 16, 2015 at 11:40 am #137329Steven McGregor
Thanks Tom
I saw a previous post where someone was doing basically a one page site and wanted to link to sections from the main menu. The custom link would look something like http://www.my-domain/#contact or http://www.my-domain/#products. The post didn’t detail how he had renamed the sections and I just can’t find it now to ask.
Anyway, I am looking forward to hearing from you on this.
September 17, 2015 at 12:26 am #137404Tom
Lead DeveloperLead DeveloperWhat you can do is add something like this into the “Text” editor of your section:
<a name="contact"><!-- contact section --></a>Then you can link to that section the same as using an ID.
Let me know if that works for you or not 🙂
September 17, 2015 at 4:22 am #137449Steven McGregor
Thanks Tom. It works almost perfectly. The only thing now is that the Menu Plus sticky menu covers up the first part of the section. It goes to the section but the section title is hidden under the sticky menu. I don’t suppose there is an easy way to fix this.
By the way WordPress doesn’t seem to like having the section content wrapped so just putting closed ‘a name’ tag at the top of the section works.
September 17, 2015 at 10:20 am #137518Tom
Lead DeveloperLead DeveloperSorry, you definitely don’t want to wrap the section content in the anchor, just place the above at the top of the content 🙂
As for the first issue, try this..
Change your anchor to this:
<a name="contact" class="target"><!-- contact section --></a>Then add this CSS:
.target:before { content:""; display:block; height:90px; /* fixed nav height*/ margin:-90px 0 0; /* negative fixed nav height */ }You’ll want to change the 90px to the height of your navigation.
September 17, 2015 at 11:09 am #137546Steven McGregor
That worked perfectly. Thank you and enjoy the coffee 😉
September 17, 2015 at 11:14 am #137547Tom
Lead DeveloperLead DeveloperGlad it worked, and thank you so much! Appreciate it! 🙂
September 25, 2015 at 2:02 am #139590Guillaume
Thank you Tom for this great add-on !
For a smooth scrolling use this : “Easy Smooth Scroll Links”
Regrads
Guillaume
September 25, 2015 at 3:51 am #139623Steven McGregor
Nice one Guillaume. Thanks.
June 5, 2017 at 2:50 pm #329035Brent
mahalo, solved a problem I was having too…
-
AuthorPosts
- You must be logged in to reply to this topic.