Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9157

    Hey Guys,

    I have a section of my site set up to hold a lot of profiles (of dogs). Each profile takes up one column of a three-column row built in the template builder. The page has several of these three column rows which get filled with profiles (posts) as they are entered.

    The number of these profiles changes constantly, so I have to keep adding or taking away the 3-column rows that aren’t used, so that I’m not left with blank boxes when there is not enough post content entered.

    Is there a way to automatically switch these boxes off, so that when there is no post available to fill the columns, they simply don’t appear at all?

    This is the link to the section I’m talking about:

    http://sosgalgos.com/?page_id=408

    Thanks

    rich

    #63665

    Hey,

    because of the way how the columns are build (columns generator and content generator functions for posts, pages, static content work independent) it’s not possible to automatically switch these boxes off. This would require a (major) rewrite of the generator function. I’d simply use an archive page because WP just displays the required posts/columns/rows on this page.

    #63666

    Hey Dude,

    But it already kind of does it, it’s just not working properly. What happens is that it leaves a small white bar which is the default empty post content area. Surely there must be a way to change the function so instead of displaying the white bar when the content is 0, it just displays nothing at all? Or turn them off after the loop has run with a special if/then command.

    If you like i can send you a link to what happens by default (I took it off that other link because it looks ugly on the page)

    I can’t use an archive page because a). I don’t know how (ha!) and b). archive pages have a sidebar and I don’t want one displayed. It has to be a three column layout for the content (we’re back to the archive with no sidebar thing again that we half started before)

    Thanks

    rich

    #63667

    I’ve found a quick fix which will remove the container box itself. However it will not remove unnecessary columns or rows (which would require a function rewrite). Open up helper-templates.php and replace:

    $output = "<div class='post-entry ".$extraClass."'>".$output."</div>";

    with:

    if (!empty($output)){
    $output = "<div class='post-entry ".$extraClass."'>".$output."</div>";
    }

    #63668

    Hey Dude,

    That’s the kind of thing I was thinking about, but i didn’t know how to write it.

    Let me try it, it might work. When I switch columns off manually I set the columns to display text only (instead of a post) and use a blank space. The row is still there in the template but nothing shows on the page. Maybe your fix will have the same effect.

    Thanks Dude!

    #63669

    Hey Dude,

    It seems to work fine!

    Thanks very much

    :O)

    #63670

    Hey!

    Good to see it work :) , marked as resolved.

    Best regards,

    Chris

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Intelligent column content’ is closed to new replies.