Wraps the single two column template content and sidebar in a parent div named content-container, which makes sure the sidebar is the same height as the content so that position: sticky; works on the sidebar.
Updates get_the_ID to get_the_ID() in the content-single.php partial so there's no ugly undefined constant error
Note that we should probably warn them that they'll need/want to remove some widgets from the sidebar now. position:sticky; doesn't allow you to scroll in the sidebar so you either wait until you're scrolled 100% down the page, or you make the sidebar height less than the viewport height by reducing the number of widgets
Currently with a ton of widgets:
With only 2 widgets:
Why
For #52
Testing/Questions
Features that this PR affects:
Single two column template and sidebar display
Questions that need to be answered before merging:
[ ] Is this PR targeting the correct branch in this repository?
[ ] Is anything broken in here?
[ ] Is it possible to add overflow: scroll; to the sidebar? Every way that I have tried has broken the sticky positioning
Steps to test this PR:
View a post with a sidebar
Scroll, scroll, scroll and make sure the sidebar stays sticky!
Changes
This pull request makes the following changes:
content-container
, which makes sure the sidebar is the same height as the content so thatposition: sticky;
works on the sidebar.get_the_ID
toget_the_ID()
in thecontent-single.php
partial so there's no uglyundefined constant
errorNote that we should probably warn them that they'll need/want to remove some widgets from the sidebar now.
position:sticky;
doesn't allow you to scroll in the sidebar so you either wait until you're scrolled 100% down the page, or you make the sidebar height less than the viewport height by reducing the number of widgetsCurrently with a ton of widgets:
With only 2 widgets:
Why
For #52
Testing/Questions
Features that this PR affects:
Questions that need to be answered before merging:
overflow: scroll;
to the sidebar? Every way that I have tried has broken the sticky positioningSteps to test this PR: