Support » Themes and Templates » how to display posts from a category into two columns?

  • João

    (@fernando-kerkhoff)


    to display the posts, I use that function that pulls only a specific category:

    ” <?php query_posts(“showposts=5&cat=1”);
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    etc etc etc

    <?php endwhile; else: ?>
    <?php endif; ?> “

    then what’s the problem?
    I need to display 10 posts in 2 columns, only this same category

    when I do a php page in regular use in the query so I

    Column 1> SELECT * FROM noticias_dados where idcat = ‘$ idcat’ order by id desc LIMIT 0.5

    column 2> ​​SELECT * FROM noticias_dados where idcat = ‘$ idcat’ order by id desc LIMIT 5.5

    then shows the top 5 in column 1 and 6-10 in column 2, how to do this in wordpress?

Viewing 1 replies (of 1 total)
  • You can use same function <?php query_posts(“showposts=10&cat=1”);
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    to control the limit of images using the css control.

    <div class=”main”>
    <div class=”img1″>
    </div>
    </div>
    .main { width:600px;}
    .img1 { width:300px; } . —— column width
    just add the full width for .main class
    add prefered width of column for img1, so that we can display two columns.

    thanks
    P5systems

    <?php endwhile; else: ?>
    <?php endif; ?> ”

Viewing 1 replies (of 1 total)
  • The topic ‘how to display posts from a category into two columns?’ is closed to new replies.