Skip to content

[WordPress] Build A Table Of Content That Can Jump To The Corresponding Page Position

Sometimes when the article is too long, it is very difficult for finding the information we need.

So, if you make a table of content in the article begin that can help people jump to the page position they want, it’s great.

First I checked the information on the Internet and used the plugin such as Easy Table. However, the problem is that such plugins require me to set the my article title H2 and H3 to a certain number, and them the plugin will automatically start to generate table of content.

But my article is actually not so structured.

To stipulate how many headings I should write a contrary to my original intention of writing articles freely in the first place.

Fortunately, in fact, the built-in anchors of the WordPress editor can already fulfill my requirements for making a table of content.


Use Anchors To Make Table Of Content

First, you have to make the structure of your table of content.

Take an example of a Linux article I wrote.

I have already set the table of content I expect to use, and all that is left is to set the anchor points.

  1. Select the jump point title
  2. Select settings > block and check for html anchor fields (usually in advanced settings)
  3. Enter the name of the anchor point your want, just remember it

In here, my anchor point named bz2.

Then go back to the table of content and insert a URL link in the bz2.

Remember to add the # before the anchor point name.

Save and publish, and you should see that the anchor is functioning normally.


References


Read More

Tags:

Leave a Reply