SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,617
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    float the sidebar?

    I created a wordpress page,
    http://fixmysite.us/gmpc/wordpress/?page_id=43
    And im trying to float the sidebar to the right on all the pages (which will only have 1-2 picture-sand that calendar thing)
    so that the main text (inside #content) would simply wrap around the sidebar (#primary) as if it was an image?

    Thanks...
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Is there a sidebar at the moment?
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Enthusiast OMGCarlos's Avatar
    Join Date
    Apr 2012
    Location
    Boston, MA
    Posts
    91
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Looks like the widget is outside the content area, and being positioned absolutely. How? I have no idea...I tried looking at the code through firebug and the best I could do is add "padding-right: 225px;" to the #content css. But that would leave a whitespace all down the right side of the page like this:



    I can see that the widget isn't actually being placed inside the #content, so it's being repositioned some other way...javascript maybe?

  4. #4
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,617
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Actually let me explain what im trying to do and you tell me how to do it

    What I'm trying to do is have that calendar widget floated to the right on all the wordpress pages, so I thought Id create a separate sidebar for the pages (sidebar-page.php), and called it by editing the page.php file
    PHP Code:
    <?php get_sidebar('page'); ?>
    I also made the CSS rule #content { margin: 0 } to get rid of the right margin and canged <div id="primary" to a span to make it inline, but I dont see any difference.
    S=Am I on the right track?
    "Oh, and Jenkins--apparently your mother died this morning."

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Maybe just put that widget inside the "content" div and float it right. The other content should just flow around it. It sould really be in a div rather than in a span, though. You've got block-level elements inside that span, which is an inline element. You are not meant to have block elements inside an inline element. A span is really for selecting some content within a block, like a part of a paragraph (the meaning of "inline").
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  6. #6
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,617
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Ya, that sounds great and its what I want to do, problem is how do I put the widget in the content area (I thought I can only put widgets in the sidebar/footer)
    How do I place the primary (widget area in the #content)?gmpc.jpg
    "Oh, and Jenkins--apparently your mother died this morning."

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    I don't know WP well enough, and I'm not sure what your template code looks like, but you'd have to see if you can track down where that coneted div is in your templates and call in the sidebar there (if the widget is in the sidebar).
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  8. #8
    SitePoint Enthusiast OMGCarlos's Avatar
    Join Date
    Apr 2012
    Location
    Boston, MA
    Posts
    91
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You know, I tried doing that for about an hour with Firebug. No matter what I did it would "absolutely" float and text would still go behind...like Ralph said, it's tough to figure out exactly whats wrong without seeing the code.

    As far as widgets are concerned, each page is sectioned off into modules. Widgets are then placed inside these modules. From your pic, it looks like there are only two module positions "Primary" and "Secondary", but no "sidebar".


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •