- This topic has 21 replies, 4 voices, and was last updated 2 years, 8 months ago by Elvin.
-
AuthorPosts
-
July 22, 2021 at 8:56 am #1866697Atif
Greetings,
I want to know if there is a way to add a sticky/floating TOC on the left side of the layout.
I want to do this only for the desktop view.
Any help would be appreciated.
Best Regards
AtifJuly 22, 2021 at 9:19 am #1866721DavidStaffCustomer SupportHi there,
for the Table of Contents you would need a plugin like Easy ToC:
https://en-gb.wordpress.org/plugins/easy-table-of-contents/
Which provides a widget for your sidebar as one of its options.
Once you have that in place we can look at the CSS you require to make it sticky.July 22, 2021 at 11:21 am #1866872AtifH David,
Thank you for your response. I already have the Easy TOC installed.
I have added that in the right side bar. My problems are:
1. I want to have this TOC on the left hand side of the article, sticky
2. I only want this TOC widget to show in blog posts, not on blog archives pages and home page.Currently, the TOC is showing on homepage and blog archives and its registering random headings on these pages.
Any help would be appreciated.
Best Regards
July 22, 2021 at 2:55 pm #1867065YingStaffCustomer SupportSo you don’t want it to show in the actual right sidebar, but left side of the screen?
If so, take a look at this video, is this similar to what you are trying to achieve but with your own content instead of social buttons?
https://youtu.be/q9YyXSBpRR0Let me know π
July 23, 2021 at 10:22 am #1868241AtifHi Ying,
Yes that is precisely what I am looking for.
July 23, 2021 at 10:27 am #1868254YingStaffCustomer SupportSo did you try to follow the video and try it with your content?
Let me know how it works π
July 23, 2021 at 2:18 pm #1868479AtifThe video does not indicate how to add the table of contents. It just shows how to add social share buttons. Do you have a similar resource for adding TOC?
July 23, 2021 at 4:46 pm #1868575YingStaffCustomer SupportCan you try to add the widget to right sidebar? So we can help with some CSS π
July 24, 2021 at 4:29 am #1868908AtifIf I change the layout to sidebar / content / sidebar, the content area becomes very small and looks ugly. Adding the screenshot below.
July 24, 2021 at 7:22 am #1869063DavidStaffCustomer SupportAre you wanting to keep the Right Sidebar and the ToC on the left ?
As its only going to work on large screensJuly 24, 2021 at 10:44 am #1869379AtifHi David,
Yes, I would like to keep the right sidebar.
The left sidebar TOC should only work on larger screens.
For the rest TOC on the Right side bar is okay.
July 24, 2021 at 4:45 pm #1869591YingStaffCustomer SupportI said to add it to the right sidebar, not left sidebar.
And please change it back to content/sidebar.
Can you do that?
July 25, 2021 at 8:25 am #1870382AtifHi its already to the right sidebar. You can find it added to all the posts.
July 26, 2021 at 7:12 am #1871395DavidStaffCustomer SupportI noticed you have the ToC in the Content as well.
What we could try is to move that element outside the content when there is room for it and position it where a left sidebar ‘would’ be.If that sounds like an option then can you add this PHP Snippet to your site:
add_action('ez_toc_before', function() { echo '<div class="custom-toc-wrapper">'; }); add_action('ez_toc_after', function() { echo '</div>'; });
Once its in place – let me know and ill look at the CSS required to move it the side.
July 26, 2021 at 8:01 am #1871633AtifSure we can try that, but pardon my ignorance, where do I add the PHP snippet? π
-
AuthorPosts
- You must be logged in to reply to this topic.