WordPress.org

Ready to get started?Download WordPress

Forums

Fill front-page rectangle with even-edged text, like a newspaper? (5 posts)

  1. elianna
    Member
    Posted 3 years ago #

    I'd like to develop a theme that such that the front page looks like an antique newspaper, where posts are fit together with media widgets to look like a full page of newspaper text. Sort of like the Tanzaku theme, except that I don't like how the bottom looks ragged (uneven lengths). Any advice on developing a theme that will fairly uniformly fill a rectangle with posts and widgets, leaving all edges fairly straight across the page?

    One possibility: I know that one can set post excerpt length for the front page in words, but I'm wondering if there's a way to set excerpt length to a certain pixel height, and then have the excerpt automatically cut off when that height is reached? If such a thing is possible (how?), it seems like it might answer my problem.

    I know how to set div/container/sidebar sizes, also, just not how to get the text inside the container to fill them perfectly so there is no empty space.

    I'd also appreciate if anyone can think of search terms that might help me find more information on this--I'm having trouble thinking of a short phrase that describes what I want to do, which makes the Googling nonproductive.

    Much thanks!

  2. Connor Montgomery
    Member
    Posted 3 years ago #

    Hi elianna,

    You could just give the div, p, or whatever containment element a display:block; and set the height to a specific pixel count, then give it an overflow-y:hidden. See this fiddle to see what I mean in action. Hopefully that helps, and let us (or me) know if that doesn't do the trick for you.

    Best,
    Connor

  3. elianna
    Member
    Posted 3 years ago #

    That seems like a good place to start. The problem is that leaves us with a truncated article without a clear way to read more. Do you have any suggestions about how to automatically insert a "read more" link where the article is getting cut off? I guess I could also just set a "read more" link to appear in a specific place right below the cut-off point (maybe easier than telling WordPress to automatically sense the cut-off point?), if I knew how to tell WordPress what article the link should point at (which I don't).

    Thanks for your help!--I'd be happy to hear more ideas.

  4. Connor Montgomery
    Member
    Posted 3 years ago #

    Yep - give the div, p, or whatever containment element a position: relative;. The, instead of just calling <?php the_content(); ?>, you could do something like <?php the_content('<span class="read">Read more</span>'); ?>, and then give the .read class a position:absolute; and then position it that way, so they are all the same?

    I think that would be a pretty nifty solution to your problem - what are your thoughts?

    Best,
    Connor
    @c_t_montgomery

  5. elianna
    Member
    Posted 3 years ago #

    Thanks for your help--that worked quite well.

Topic Closed

This topic has been closed to new replies.

About this Topic