Forums

List of articles (3 posts)

  1. thirdeyeblind82
    Member
    Posted 1 year ago #

    Hi guys,
    I'm developing a website and in the homepage I should have an article from one category (with picture and some text) and belove a list of 3 articles from the same category (just date and titles).
    How can I do?

    Thanks everybody!

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    link to your site?

    where exact is your problem with that?
    getting the first post to show different?
    getting posts of a category?
    getting four posts?
    the_loop?

    http://codex.wordpress.org/Function_Reference/query_posts

    general idea:

    <?php query_posts('category_name=onecat&posts_per_page=4');
    if(have_posts()) : $count = 1;
    while(have_posts()) : the_post();
    if( !is_paged() && $count == 1 ) { ?>
    show your post with image and text
    <?php } else { ?>
    show the date and title
    <?php }
    $count++; endwhile; endif;
    wp_reset_query(); ?>
  3. thirdeyeblind82
    Member
    Posted 1 year ago #

    Thank you alchymyth! I'm not an expert of php but I created a loop, similar to yours and I solved it!
    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags