• Resolved mprprojects

    (@mprprojects)


    Hello, is there a way to add the navigation (previous/next post) and the comments section to the table of contents?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @mprprojects?

    I hope you are doing well.

    I am sorry to disappoint you but currently, the Table of Contents doesn’t have the navigation and comments sections feature right now.

    With that being said, there are existing feature requests, so I’ve added your vote to our internal suggestion lists. If your suggestions are something that we’re able to introduce, we’ll be sure to let you know.

    If you have any further questions, please let us know.

    Thank You

    Thread Starter mprprojects

    (@mprprojects)

    Ok, I see. Thanks for your reply. For anybody who’s interested, as a temporary fix I did the following:

    • In my post template I added a html anchor “post_navigation” to the navigation block and another anchor “post_comments” to the ‘Comments’ text block.
    • In function generate_toc in file wp-content/plugins/table-of-contents-block/includes/helpers.php I added the following before the return statement (return $toc):
    $toc .= "<ul style=\"list-style-type: none;\">";        $toc .= "<li><a href=\"#post_navigation\">Post Navigation</a></li>";
    $toc .= "<li><a href=\"#post_comments\">Comments</a></li>";
    $toc .= "<li><a href=\"#respond\">Create Comment</a></li>";
    $toc .= "</ul>";

    That works fine for my purpose.

    Hello @mprprojects?,

    Greetings.

    Thanks a lot for sharing the details. Your cooperation is greatly appreciated. We will forward this query to the DEV team, and if possible, we will add this for future improvements.

    Best regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding Link to Comments to TOC’ is closed to new replies.