Generate sidebar depending on height of post (4 posts)

  1. peek
    Posted 3 years ago #

    Hi there!

    I'm building a site which features sidebars next to each post/article displaying random thumbnails linking to other posts.
    Each sidebar should never be longer/bigger than the post it's sitting next to.
    Now of course the height of the posts vary and I want to find out/calculate the height of each post and then generate a sidebar with more or less thumbnails.

    What would be the best way to make this happen?


  2. peek
    Posted 3 years ago #

    well, so far i know i can get a divs height with javascript.
    the problem is, the moment i can do that, php is already finished generating the html and so the sidebars...

  3. WPyogi
    Forum Moderator
    Posted 3 years ago #

    Perhaps putting both the post div and the thumbnails div in another div and using overflow hidden on the thumbnails div?

  4. peek
    Posted 3 years ago #

    i thought of that too, but that would mean, i would overlap the next post...

    heres a screenshot of the design/sketch:

    here is a current version: http://aq295.w4yserver.at/wordpress/
    but a lot is still to be done, work in progress!

    how about getting div height, the first time php generated a post and save that value for each post. then use this value, the second time the page gets viewed, to generate the corresponding sidebar. am i crazy?

Topic Closed

This topic has been closed to new replies.

About this Topic