WordPress.org

Forums

want to list posts and categories at index page (3 posts)

  1. kurtcuk
    Member
    Posted 6 years ago #

    This is the thing that i want

    I want to do this at my index page, i' dont have problems with design, but i want to know the codes (and the wp functions) that answers my question.

    Thanks.

  2. mores
    Member
    Posted 6 years ago #

    I'm working on something similar ... will reply once I get it :)

  3. mores
    Member
    Posted 6 years ago #

    Well, you will see on mores.cc that I have a similar setup now.

    My code for the little category-boxes at the bottom (I removed the "unimportant" stuff like my categoy names and the header images):

    <div id="col_0">
    	<div id="col_headline">Kategorie: Privat</div>
    	<?php query_posts('category_name=cat1&showposts=5'); ?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<div id="col_post"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
    	<?php endwhile; else: ?>Oops!
    <?php endif; ?>
    </div>
    
    <div id="col_1">
    	<div id="col_headline">Kategorie: Food</div>
    	<?php query_posts('category_name=cat2&showposts=5'); ?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<div id="col_post"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
    	<?php endwhile; else: ?>Oops!
    <?php endif; ?>
    </div>
    
    <div id="col_0">
    	<div id="col_headline">Kategorie: Privat</div>
    	<?php query_posts('category_name=cat3&showposts=5'); ?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<div id="col_post"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
    	<?php endwhile; else: ?>Oops!
    <?php endif; ?>
    </div>
    
    <div id="col_1">
    	<div id="col_headline">Kategorie: Food</div>
    	<?php query_posts('category_name=cat4&showposts=5'); ?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<div id="col_post"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
    	<?php endwhile; else: ?>Oops!
    <?php endif; ?>
    </div>

Topic Closed

This topic has been closed to new replies.

About this Topic