WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Change recent articles that display in sidebar (i.e. #11-20) (7 posts)

  1. Storyman
    Member
    Posted 6 years ago #

    First, let me say I really admire the work done on Word Press and all of the great themes and plugins created by contributors.

    Currently the headlines for the 10 most recent articles are displayed in the sidebar. I'd like to change it to display the headlines for articles 11-20.

    How do I do this?

  2. drmike
    Member
    Posted 6 years ago #

    Depends. How are you currently displaying 1-10? Are you using a plugin or widget or template tag or what?

  3. moshu
    Member
    Posted 6 years ago #

    We don't know, since you didn't give us:
    a) a link
    b) a theme name
    c) the code used to display the last 10... etc.

  4. Storyman
    Member
    Posted 6 years ago #

    Thanks for the prompt replies.

    a) The site: http://www.disabilityhappens.com/
    b) Theme used: memoir-10
    c) Code used to display the most recent 10 post:
    $today = current_time('mysql', 1);
    if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 10")):

    Rather than display the headlines for articles 1-10, I'd like to display the headlines for articles 11-20.

    Thanks for your help.

  5. Storyman
    Member
    Posted 6 years ago #

    By any chance does anyone know if there is a widget that will accomplish this? The theme does work with widgets.

    I'd prefer to just alter the code, so if anyone has a suggestion...

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Simplest way: Change "LIMIT 10" to "LIMIT 10,10".

  7. Storyman
    Member
    Posted 6 years ago #

    Thanks Otto42. That was exactly what I needed.

Topic Closed

This topic has been closed to new replies.

About this Topic