I would like to add "Jump to section" links directly to the WordPress search results.
Example: Say I have long product page with description of several products. Say the page "Products" contains "Flux Capacitor", "Shrink ray" and "Batvision" products.
Now, if someone searches for "Batvision", they (correctly) see link to "Products" page. However, in order to find the Batvision, they have to scroll way down to correct section of such page.
Basically, I am trying to find this solution, but using WordPress search:
Is there a way how to achieve it? And if so, how?
I would like to add "Jump to section" links directly to the WordPress search results.
Example: Say I have long product page with description of several products. Say the page "Products" contains "Flux Capacitor", "Shrink ray" and "Batvision" products.
Now, if someone searches for "Batvision", they (correctly) see link to "Products" page. However, in order to find the Batvision, they have to scroll way down to correct section of such page.
Basically, I am trying to find this solution, but using WordPress search:
Is there a way how to achieve it? And if so, how?
Share Improve this question edited Feb 25, 2021 at 11:12 Pavel Janicek asked Feb 25, 2021 at 9:50 Pavel JanicekPavel Janicek 2123 silver badges14 bronze badges1 Answer
Reset to default -1You should have the navigation menu with anchors on your page.
<ol>
<li><a href="#products">Products</a></li>
<li><a href="#examples">Example</a></li>
</ol>
And the sections with relevant ID where are these anchors are linked to.
<h2 id="products">Products</h2>
After the changes are done, ask google to reindex your page and wait=)
Here is detailed description: here