Archived topic
Creating or changing the Section IDs
10 replies · Started by Anonymous on September 16, 2015
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.
Hmm, interesting - I don't know if this is possible right now.
Let me look into it :)
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.
What 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 :)
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.
Sorry, 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.
That worked perfectly. Thank you and enjoy the coffee ;)
Glad it worked, and thank you so much! Appreciate it! :)
Thank you Tom for this great add-on !
For a smooth scrolling use this : "Easy Smooth Scroll Links"
Regrads
Guillaume
Nice one Guillaume. Thanks.
mahalo, solved a problem I was having too...