Support » Fixing WordPress » Category in a box with css overflow scroll, but loop repeats boxes.

  • I’m making a page with a unique homepage, on this unique homepage I’m only showing one category. I want to show it in a small box, with scrolling (done with css). But the loop, (because it’s a loop) repeats the box for each post. I wan’t all the post to be in the box. I’m thinking that I have to wrap the loop somehow and style that wrap with css? Is there anyone who can point me in the right direction. Can’t find the solution within the codex, but it should be in there somewhere. Or if you know or have suggestions how to solve this it would be much appreciated.

    Working on my first WP page.

Viewing 10 replies - 1 through 10 (of 10 total)
  • please post a link to your site to illustrate the problem;

    if you would like someone to have a look, you can paste the full code of your template into a and post the link to it here – see forum guidelines

    alchymyth Thanks for the answer.

    Heres a link to a screen image of the top of my Front page and the bottom. The problem is visible at the bottom.



    Link to my css

    Link to my home.php

    I hope someone can help me… And the Css is a bit cluttered and home.php file contains some elements I’m still thinking about what to do with.

    Me again sorry I forgot to mention that the container for the information box
    is on row 204 #info-container.

    try to move the #info-container div to the outside of the loop;

    example edited home.php:

    alchymyth thanks again for a fast reply.
    I tried to do that, what happens is that only the top post is in the box, the box is not repeated but the other post are below the image of the front page.

    Image link

    please pastebin the code of your template home.php as it is now.

    Thanks again, here is the code as it is now.

    alchymyth I thoulght I solved it by putting in a query after “<?php while (have_posts()) : the_post(); ?>”

    <?php query_posts(“posts_per_page=6”);the_post();?>

    but it seems that it endlessly repeats the loop in the box.
    and the footer disapears. But maybe I’m moving in the right direction?

    remove this:

    <? wp_reset_query();?>
                                                    <?php query_posts("posts_per_page=6");the_post();?>

    if you want to restrict the number of posts, possibly change this:




    and remove this from line 32:

    <? wp_reset_query();?>

    it still does not explain why the posts are running out of the container – unless there is some odd stuff in ‘/inc/meta.php’

    it would help to check these things if you can post a live link to your site.

    Thank you again alchymyth. Sorry for my late reply, I have been mobile and not working on the site for the last two weeks.

    I don’t have a live site so I can’t post a link to my site. It’s on my computer on a local server.

    The present page is on a server with a drupal set up. But maybe it’s possible for me to set up my wordpress site as well?

    The meta.php looks like this.

    <div class="meta">
    	<em>Posted on:</em> <?php the_time('F jS, Y') ?>
    	<em>by</em> <?php the_author() ?>
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Category in a box with css overflow scroll, but loop repeats boxes.’ is closed to new replies.