• Hello,

    For a template I’m developing I want to have two views for my articles. The 5 latest articles are some bigger then articles posted earlier (6 to 15).

    Layout:
    Article 1 (Date, title, first text, read more, author, amount of reactions)
    Article 2 (Date, title, first text, read more, author, amount of reactions)
    ..
    Article 5 (Date, title, first text, read more, author, amount of reactions)

    Older posts (list of posts made earlier)
    Article 6 (Date, title, read more, amount of reactions)
    ..
    Article 15 (Date, title, read more, amount of reactions)

    I’ve found a little script that makes me skip the amount of posts that I want, but I only get the title back from it.

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 3 replies - 1 through 3 (of 3 total)
  • you could use a conditional statement to show the first five posts different; example:

    /*START OF THE LOOP*/; the_post();
    if($wp_query->current_post < 5 && !is_paged() ) :
    /*HOW TO SHOW THE FIRST FIVE POSTS*/
    else:
    /*HOW TO SHOW ALL OTHER POSTS*/
    endif;
    endwhile; /*END OF THE LOOP*/
    Thread Starter utregfanatic

    (@utregfanatic)

    Ok, will give it a try.

    But i posted some code here and it’s gone.

    [code moderated - please use the pastebin for any code longer than 10 lines]

    Thread Starter utregfanatic

    (@utregfanatic)

    I’m not a coder, but what I want to know is if it’s possible to code it in to this (first) line of the code:

    function mdv_recent_posts($no_posts = 5, $before = 'SHOW THE DATE OF THE POST', $after = ' SHOW THE READ MORE LINK, SHOW AMOUNT OF REACTIONS', $hide_pass_post = true, $skip_posts = 5, $show_excerpts = false) {

    This code comes from the file functions.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Skip posts in post list’ is closed to new replies.