How to use a table of contents on any web page or blogger post? With source code.

0

 Use a table of contents on your web page or blogger post. 




Q. Why use a table of contents (TOC) on a web page or blog post?

=> There are several reasons why you might want to use a table of contents (TOC) on a web page or blog post:

  • Improved navigation: A TOC allows readers to quickly navigate to specific sections of a long article or webpage. This can be especially helpful if the page or post is very long and has many sections.

  • Better organization: A TOC helps organize the content of a page or post, making it easier for readers to find the information they are looking for.

  • Increased readability: A TOC can make a long page or post easier to read by breaking up the content into shorter, more manageable sections.

  • Improved search engine optimization (SEO): A TOC can help improve the SEO of a webpage or blog post by providing a clear outline of the page's content. This can make it easier for search engines to understand the page's content and rank it higher in search results.

  • Enhanced user experience: A TOC can improve the overall user experience by making it easier for readers to find and read the content they are interested in.


Table of Contents


Step 1: Copy all code snippets from the box below by clicking the copy button.

Preview: 


      

    <div id="ez-toc-container"
        class="ez-toc-v2_0_36_1 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction toc_close">
        <div class="ez-toc-title-container">
            <p class="ez-toc-title">Table of Contents</p>
            <span class="ez-toc-title-toggle"><a href="#"
                    class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle"
                    style="display: flex;"><label for="item" aria-label="Table of Content"><span
                            style="display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;"><svg
                                style="fill: #999;color:#999" xmlns="http://www.w3.org/2000/svg" class="list-377408"
                                width="20px" height="20px" viewBox="0 0 24 24" fill="none">
                                <path
                                    d="M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z"
                                    fill="currentColor"></path>
                            </svg><svg style="fill: #999;color:#999" class="arrow-unsorted-368013"
                                xmlns="http://www.w3.org/2000/svg" width="10px" height="10px" viewBox="0 0 24 24"
                                version="1.2" baseProfile="tiny">
                                <path
                                    d="M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z">
                                </path>
                            </svg></span></label><input type="checkbox" id="item"></a></span>
        </div>
        <nav>
            <ul class="ez-toc-list ez-toc-list-level-1" style="display: block;">
                <li class="ez-toc-page-1 ez-toc-heading-level-2"><a class="ez-toc-link ez-toc-heading-1"
                        href="#advantage-of-child-themes">Advantage of Child
                        Themes:</a></li>
                <li class="ez-toc-page-1 ez-toc-heading-level-2"><a class="ez-toc-link ez-toc-heading-2"
                        href="#how-to-create-a-wordpress-child-theme-without-plugin-with-code">How to Create a
                        WordPress Child Theme without Plugin? [with Code]</a></li>
                <li class="ez-toc-page-1 ez-toc-heading-level-2"><a class="ez-toc-link ez-toc-heading-3"
                        href="#notes">Notes:</a></li>
                <li class="ez-toc-page-1 ez-toc-heading-level-2"><a class="ez-toc-link ez-toc-heading-4"
                        href="#plugins-to-create-wordpress-child-theme">Plugins to create WordPress child theme</a></li>
                <li class="ez-toc-page-1 ez-toc-heading-level-2"><a class="ez-toc-link ez-toc-heading-5"
                        href="#why-should-you-use-wp-enqueue-style-instead-of-import-to-load-css-stylesheet-in-wordpress-child-theme">Why
                        should you use wp_enqueue_style instead of @import to load CSS stylesheet in WordPress child
                        Theme?</a></li>
                <li class="ez-toc-page-1 ez-toc-heading-level-2"><a class="ez-toc-link ez-toc-heading-6"
                        href="#reference">Reference:</a></li>
            </ul>
        </nav>
    </div>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/janak0ff/Responsive-Table-of-content@master/tablestyle.min.css">
    <script src="https://cdn.jsdelivr.net/gh/janak0ff/Responsive-Table-of-content@master/tablescript.min.js"></script>

   

Step 2: Paste the copied code into your text editor. And customize according to your needs.

Note: simply change href="#your-custom-id"

Step 3: Apply on blogger post.

Follow: Create new Post > HTML view  > paste your code here.



Step 4: Apply on HTML page.
             Simply, Just paste code in your HTML file.


Conclusion :
            In conclusion, using a table of contents can be a helpful tool for improving the navigation, organization, readability, and overall user experience of a web page or blog post, especially if the content is long or complex. A TOC can also help improve the SEO of a page or post by providing a clear outline of the content. To use a TOC on a web page or blogger post, you can either create one manually using HTML or use a plugin or tool that automatically generates a TOC based on the headings in your content.

FAQs:
         Here are some frequently asked questions about using a table of contents on a web page or blog post:
There are several ways to create a table of contents for a web page or blog post. One option is to use a plugin or tool that automatically generates a TOC based on the headings in your content. Alternatively, you can create a TOC manually by adding hyperlinks to specific sections of your content.
Yes, most tools and plugins that generate a TOC allow you to customize the appearance of the TOC, including the font, color, and size of the text, as well as the layout and design.
It's not necessary to include a TOC on every web page or blog post, especially if the content is short or there are only a few sections. However, a TOC can be helpful for longer pages or posts that have a lot of content, as it can make it easier for readers to navigate and find the information they are looking for.
Yes, a TOC can potentially improve the SEO of a web page or blog post by providing a clear outline of the content and helping search engines understand the structure and organization of the page. This can make it easier for the page to rank higher in search results.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
Top