Hi, I want a sidebar width to be exactly 300px. On browser resizing, if 300px sidebar width content can’t be fit it in, I don’t want to see a responsive sidebar by becoming slimmer & slimmer but rather I want the sidebar to be dropped to the bottom of the page. I have tried many CSS tweaks but could not make it work. BTW I have smart sidebar option turned on from theme panel as well.
Could you please suggest exactly what do I have to do to achieve this?
Thanks, JK
Hi,
Custom sizes you can define yourself are not possible with the tagDiv composer on pages or posts. You can split the row or stretch the rows to predefined sizes, but to set a desired width for a column is not possible.
The widths are calculated automatically in percentages, based on the layout you choose
– https://www.screencast.com/t/Ynx0UlrUlz
The content in sidebar like blocks or other widgets have predefined padding, margins and other design based on those percentages. So if they are changed the result will probably be a broken sidebar or entire page.
This level of flexibility is not yet possible with the composer. As it is further developed maybe such options will be available.
Thanks
Hi Simion,
One of the ad networks that I plan to partner with has this requirement. As the browser resizing action happens, the sidebar width shrinks and that will show cut-up ad which violates their ad-policy rules. The ad network wants to be loyal for their advertisers to show their ads in full size. If 300px can’t be displayed, then it should fall to the bottom of the page.
It is a real disappointment that NP doesn’t support this. Now I have to research another theme in the market which does this for me.
Thanks.
Hi,
You could use different ads by viewport, this is a possibility
– https://forum.tagdiv.com/using-other-ads-non-adsense-ads/
Using the predefined containers would allow to display different ads by device.
The sidebar will drop below the content only on phones. On other devices it will be resized automatically as the container shrinks in width. A setting to keep this from happening or change the sidebar behaviour does not exist. Sorry for the inconvenience.
Thanks
Hi Simion,
After a lot of trial and error, I achieved what I wanted with NP theme itself but just 1 caveat (I had to lose the sticky smart sidebar feature).
This custom CSS does the magic.
@media (max-width: 1018px) and (min-width: 768px)
{
.td-pb-row [class*="td-pb-span8"] {
padding-right: 14px;
padding-left: 14px;
width: 100%;
}
.td-pb-span4 {
width: 324px;
}
}
I think I need some customizations to js/tagdiv_theme.js file to handle the stickiness around this section of the code:
if (tdUtil.getBackendVar('tds_smart_sidebar') == 'enabled' && tdDetect.isIos === false) {
Basically if we can avoid sticky sidebar if the width is between 768 & 1018 in this code section, I think I’ll be all set.
Could you show me a piece of code that does the check for the screen size in jquery and not trigger the event for scroll-up.
Let me know if this makes any sense.
Thanks, JK
-
This reply was modified 8 years by
jkfriends.
Hi,
That code will set the post content to 100%, and the sidebar will be below the post content, within those widths.
Note that the code will affect pages as well, the same spans are used for pages. The code would have to be more specific.
Or maybe to reduce the main content span to make room for the bigger sidebar instead, while also more specific.
But this may not be a good solution, modifying the website structure to display the ads, maybe the ads can me modified to adapt or change automatically as it is usually possible with most ad providers. Responsive ads or changing them like I mentioned would be the way to go.