Wrap text around sidebar
I’m working on the site new.xpient.com, and on the side pages, I’m wanting to have it only a certain height. After that certain height I want the content text to fill in the area below it. I’m working with a twentyten child theme. Can anyone help me with this?
You would need to change the structure of the page — so that the “sidebar” (not really a sidebar anymore) is “floated right” inside the main section. So you would have:
<main section div> <side div> float this right with CSS put the content for the side div here </side div> close this div put the content for the main div here </main section div>
You can set the width of the side div with the CSS.
Can I make this work with dynamic content and the blog though?
Yes, the layout of the page won’t change the content so long as you put the content php in the sections where you want it. See custom template .
So I need to edit sidebar.php to give it a set height instead of 100% (This is what I’m assuming is happening)
No, the “sidebar” div would need to be completely inside the container div — as I showed above in the basic structure that you would need. The content (dynamic) in each section would not necessarily change. You would not set a height for the “sidebar” as that is determined by the amount of content in that div.
So what do I need to edit in what file to accomplish this?
I’m not trying to bump the thread, but here’s an image of what I want.
Can anyone tell me in detail, what needs to be done to accomplish this?
Okay, if anyone is stil reading…
By editing my loop-page.php I was able to create a div for #sidebar, however even if I put <?php get_sidebar(); ?> in loop-page.php within the div, the sidebar is not getting populated.
Here’s my pastebin link
Anyone have any ideas?
I’m not a php coder by a long shot — which is why I have not responded sooner — but why are you messing with the loop? The get_sidebar() is outside the loop — look at any of the page templates — index, page, single…
If you put the get_sidebar() in the loop, it’s getting called twice…
It seems like all you need to do is move the get_sidebar() to just below this line
<div id="content" role="main">(above the loop call) in the templates your site uses. Then you’d need to modify the CSS for the sidebar accordingly.
Okay, I moved it above
<div id="content" role="main">but it’s not doing anything at all, do I need to wrap it in a div or anything?
Also it’s worth noting, I want to put the sidebar within the actual post.
It IS a div. And it IS in there — content is not showing up — I don’t know enough to know why — sorry. I also don’t think putting it inside the posts is the way to go. Putting it where I suggested will put it right next to the posts — which WILL wrap post content around the sidebar.
But as I’ve said you will also need to change some CSS to make the alignment work.
You also need to sort out these mark-up errors before trying anything else:
- The topic ‘Wrap text around sidebar’ is closed to new replies.