Wrapped Sidebar suggestion
-
As per Tom’s suggestion, posting this request here. The text I posted from the Facebook page is copied below verbatim, but here is a (slightly) more formal set of requirements.
REQUIREMENTS
. A sidebar presentation where the main article body wraps underneath the vertical scope of the sidebar
. Sidebar can be on left or right or article
. Doesn’t require any change in how the contents of the sidebar are managed
. Either a sensible default or some configuration over how the sidebar is displayed on mobile (the most obvious default would seem to be below the article body)
. Wrapped content from article text would extend to the same horizontal width as the sidebar
. Some way to decorate the sidebar such that it’s real estate is obvious and manageable (padding, borders, etc). This is probably a P2.
FACEBOOK POST
Is there any such thing (in GeneratePress or more generically) as a “wrapped sidebar”?
I generally have quite sizable articles. When I use a sidebar there is a ton of vertical real estate under the sidebar that is wasted (this is obviously an issue with WordPress sidebars generically).
I was wondering if anyone had any creative solutions to this, while still being responsive. I’ve never seen anything that does this – but it just seems a shame with all that space under the sidebar (while the lower parts of an article might have a beautiful image displayed smaller than I would like, potentially, just because of the sidebar way higher).
By the way, I suspect this could be resolved with some plugin somehow (plugins solve anything, right :)) but I still want to be able to manage the contents of the sidebar in the traditional ways.
-
Hi Mark,
Give this a shot:
add_filter( 'generate_sidebar_layout','tu_no_sidebars' ); function tu_no_sidebars() { return 'no-sidebars'; } add_action( 'generate_before_content','tu_sidebar_inside_content' ); function tu_sidebar_inside_content() { get_sidebar(); }Then you can float the sidebar to the left or right with some CSS:
#right-sidebar { float: right; }Tom,
Works great! 🙂
Cheers!
LyleSmall update,
no-sidebarsin the first function should beno-sidebar.
The topic ‘Wrapped Sidebar suggestion’ is closed to new replies.
