Hi there! 👋 Yes, you can create this in WordPress. Here’s a step-by-step guide to help you set this up:
- Create the Sidebar:
- In your WordPress dashboard, go to “Appearance” > “Widgets”.
- Here, you can add a new sidebar if your theme supports it. Alternatively, you can use an existing sidebar area.
- Drag and drop the “Navigation Menu” widget into your sidebar area.
- Create a Custom Menu for Sidebar:
- Go to “Appearance” > “Menus”.
- Create a new menu and add links to the content you want to display in the sidebar. These could be pages, posts, custom links, or categories.
- After creating the menu, assign it to the sidebar widget area where you placed the “Navigation Menu” widget.
- Make Sidebar Scrollable:
- To make the sidebar scrollable, you will need to add custom CSS. Go to “Appearance” > “Customize” > “Additional CSS”.
- Add the following CSS code:cssCopy code
.your-sidebar-class { overflow-y: auto; max-height: 400px; /* Adjust the height as needed */ }
- Replace
.your-sidebar-class
with the actual CSS class of your sidebar. You can find this by inspecting the page using your browser’s developer tools.
- Ensure Links Don’t Navigate Away:
- If you want the links in the sidebar to load content without navigating away from the page (like W3Schools), you’ll need to use AJAX or a similar technique. This is more complex and might require a custom plugin or a developer’s assistance.
- Alternatively, you can link to anchor points within the same page. This will allow users to jump to different sections of the page without loading new pages.
- Testing:
- After setting everything up, test your sidebar to ensure it works as expected.
Hope this helps!
Dear Michal Czaplinski (@czapla)
I want to create for single page/post not for whole website.