WordPress.org

Ready to get started?Download WordPress

Forums

Is this even possible? Separating images from posts (7 posts)

  1. judeboden
    Member
    Posted 6 years ago #

    I had a design in mind for my theme where the post text would appear in a column on the left and the images for that post would appear in a column on the right.
    I've floated the images to the right but it's not exactly what I was looking for. The text flows into the images and I had a more separate look in mind.
    Basically what I wanted to do was set the width of the text to 50% and have the images reside in the other 50% of the page.
    I realise that the post and its images are both contained within #content but is there a way to separate or do I need to rethink my plans?
    Any help appreciated.

  2. yogipress
    Member
    Posted 6 years ago #

    sounds interesting. show us what you have so far.

  3. moshu
    Member
    Posted 6 years ago #

    What is so complicated in this?
    What is the width of you content area? - Say, 450px.
    Div by 2 = 225. Counting with a 5px margin you should use ONLY pics 220px wide. + 5px margin on the left to "keep away" the text. And float it right in the stylesheet witha class. The text will automatically wrap around it.

    The only complication: you should not write* text longer than the images; otherwise the text will wrap around the pic.

    * use "more" or the-excerpt-reloaded to control this

  4. Kafkaesqui

    Posted 6 years ago #

    If you're looking for a more programmatic way of accomplishing this I might have a few ideas, but I think moshu's solution works pretty well.

  5. moshu
    Member
    Posted 6 years ago #

    :)
    Yep - that's how it is around here:
    if you want a nice, elegant code (aka programmatic way), then wait until Kaf stumbles upon your post.

    If you are OK with some less elegant but practical "user-focused" solutions - sometimes I might come up with those.

  6. SimonJ
    Member
    Posted 6 years ago #

    moshu said : "The only complication: you should not write* text longer than the images; otherwise the text will wrap around the pic."

    Not necessarily... You can wrap in a container another div for the text... Just the same as you have with two columns in a theme..

    <a container>
    <a right floating image div>
    <a text div with margin right the width of the div above>

    S.

  7. Kafkaesqui

    Posted 6 years ago #

    One typically expects images will fall in line (so to speak) with the content they're related to. Imagine how the layout would work without the css. It's good to keep in mind how a feature degrades if it is somehow turned off, or if the tool used to view it does not take interest in your design and whatnot.

    So your solution is more elegant than you may think, moshu. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.