Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   [SOLVED] Custom Widget area to appear outside of wrapper? (http://forum.bytesforall.com/showthread.php?t=16274)

lehacarpenter Dec 15, 2011 12:44 PM

[SOLVED] Custom Widget area to appear outside of wrapper?
 
Hi:

I was wondering if anyone had ever tried adjusting a custom widget area (using CSS?) to appear actually outside of the wrapper?

My goal is to increase a visitor's ability to navigate the posting content of various categories, so I'm trying to make a simple Categories menu that will appear either on every page, or just on posting pages (the latter would be better, but I'm not picky).

The problem is, I don't have room for sidebars on the posting pages, so I set the site up to make sidebars go away on posting pages (I don't want to make the whole wrapper wider, because it would be too--um--wide). I'd like a categories menu that appears flush left, on the right side of the site, just outside the wrapper. Is that something I could just push over using position? I'm not sure how to set that up. Seems like if I use absolute position it will be different depending on the browser, because the wrapper itself is centered... This is where I get lost.

If nobody's done this kind of thing, I understand. Just thought I'd try. :)

Thanks!

Leha

lmilesw Dec 15, 2011 09:04 PM

There are ways to do what you want but a rather simple solution is to use the Floating Menu plugin which you can position so many pixels down from the top and in from the right or left.

lehacarpenter Dec 15, 2011 09:37 PM

Yes! Thank you--that sounds perfect! :)

lehacarpenter Dec 16, 2011 12:21 AM

Darn it, but that wasn't quite what I was looking for. The reason it needs to be a widget area (as opposed to a widget) is that I need to put a widget into it. Specifically, I was going to use "recent posts," and set it to a really large number, so that people can just click the next one they want to look at from the list, rather than having to go back to the category to get a list.

The floating menu is really cool, but it can only give me the menus I already have, and only in the active sidebar, which is kind of the opposite of what I need, where I want a menu to be out there on the periphery in cases where I have sidebars turned off completely.

So it looks like the thing I need to figure out is how to make a widget area that I can place outside the wrapper, and then add the recent posts widget to that...

Thanks again for the idea, though. Maybe I'll try to find another plugin that can do that...

Leha

lmilesw Dec 16, 2011 10:28 AM

What you can do then is create a new widget area and position with CSS. I would probably put the new widget area in HTML Inserts: Body Top and use absolute positioning to put it where you want.

lehacarpenter Dec 16, 2011 01:19 PM

Thanks so much, Larry. I tried that, but could not figure out initially how to make the widget appear just outside the centered wrapper. I kept thinking I was going to have to fetch the width of the browser window and divide by two, which is a gnarly problem, but then it dawned on me that all I had to do was set the wrapper's position attribute to "relative," put the widget area just inside the wrapper, and then position absolutely with the wrapper as parent. This worked perfectly!

I'll bet someone will come along one day who also wants to know how to do this, so here are the steps, for them:

In CSS.php, in the wrapper style, add "position: relative;".
In header.php, just under the wrapper tag, add your custom widget area code (per ATA construction guidelines).
In HTML/CSS Inserts, in the CSS section, style the widget as in this example:

#my_widget_area {
position: absolute;
display: block;
width: 200px; //or however wide you want it
left: 874px; //or right, number of px from edge of wrapper
top: 630px; // number of px from top of wrapper
}

And that's all that's needed to take advantage of outer space exploration. ;)

Thanks again for your help, Larry!

Leha

lmilesw Dec 16, 2011 02:03 PM

positon: relative on the wrapper and even the container has been my friend many times with regards to absolute positioning. Good job.


All times are GMT -6. The time now is 04:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.