WordPress.org

Ready to get started?Download WordPress

Forums

Wrap text around sidebar (14 posts)

  1. collinxstyles
    Member
    Posted 2 years ago #

    Hey guys,

    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?

  2. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    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.

  3. collinxstyles
    Member
    Posted 2 years ago #

    Can I make this work with dynamic content and the blog though?

  4. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    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 .

  5. collinxstyles
    Member
    Posted 2 years ago #

    So I need to edit sidebar.php to give it a set height instead of 100% (This is what I'm assuming is happening)

  6. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    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.

  7. collinxstyles
    Member
    Posted 2 years ago #

    So what do I need to edit in what file to accomplish this?

  8. collinxstyles
    Member
    Posted 2 years ago #

    I'm not trying to bump the thread, but here's an image of what I want.

    http://imgur.com/TJh72

    Can anyone tell me in detail, what needs to be done to accomplish this?

  9. collinxstyles
    Member
    Posted 2 years ago #

    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

    http://pastebin.com/W9G6DgDr

    Anyone have any ideas?

    Thanks

  10. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    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.

  11. collinxstyles
    Member
    Posted 2 years ago #

    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?

  12. collinxstyles
    Member
    Posted 2 years ago #

    Also it's worth noting, I want to put the sidebar within the actual post.

  13. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    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.

  14. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic