Bluemad
Member
Posted 3 months ago #
Hello!
I saw that some of the WordPress bloggers use direct links to a specific post sub heading. Once user click on that link, it automatically open that blog post and scroll down to the focused sub heading. How do I do it?
Most of these links are just like this http://mydomain.com/mypost.html#
If i put my subheading after the #, nothing happen, only open the blog post. :(
Bluemad
Member
Posted 3 months ago #
I saw this type of thing use Disqus, for instance. http://mydomain.com/mypost.html#comment-787684982
Yes, that should be possible, but you have to have and use a valid id for the sub-heading being linked to. For example, in the link above, the comment being linked to would have this id in the HTML for that comment - something like:
<div id="comment-787684982" .... >Comment here</div>
So that will only work if your subheadings have id's or you assign them in the HTML of your content.
Bluemad
Member
Posted 3 months ago #
Friend, is this method correct?
For instance I have a sub heading, it's How to use Google
Then I added this type of thing to post text area.
<div id="How to use Google">How to use Google</div>
Is it OK?
Bluemad
Member
Posted 3 months ago #
Yes, it working. Thank you friend. :D