Archived topic
Create Table of Content in the Sidebar
5 replies · Started by kiant123 on October 5, 2022
Hi,
I'm using easy table of contents to put a table of contents into the sidebar on desktop. It appears to have worked, however, is there a way for the table of contents to appear at the top of the post for mobile and tablet? Since it's a widget in the sidebar it appears at the bottom. Is there a way to do this? Or would I be better off creating a block?
Would appreciate your advice on this.
Thanks.
Hello there,
Will your sidebar add also be appearing on mobile and tablet? If so, would it be okay to be placed on top as well on mobile and tablet?
If so, can you try adding this CSS:
@media (max-width: 1024px) {
div#content {
flex-direction: column-reverse
}
aside#ezw_tco-2 {
padding: 0;
}
}
Add this in Appearance > Customize > Additional CSS.
Hi,
Thank you for your help.
My fault here, but I meant to say to put it under the title and featured image and start just before the content.
What I've done instead is I've created a block with the table of contents shortcode. Is there now a way to remove the sidebar from mobile? This way I don't have a TOC at the top and bottom on mobile view.
Hi there,
try this CSS:
@media (max-width: 768px) {
#right-sidebar {
display: none;
}
}
Worked perfectly. Thank you!
Glad to hear that !