WordPress.org

Ready to get started?Download WordPress

Forums

Limiting the amount of posts on a page (3 posts)

  1. ConnorP
    Member
    Posted 1 year ago #

    I am trying to limit the amount of posts that appear on my home page and blog page in my thematic child theme using query_posts but it currently isn't working. In my functions.php I'm using:

    function limitPosts() {
    if (is_home() || is_category('blog')){
    query_posts( 'posts_per_page=3' );
    }
    }
    add_action('wp_head', 'limitPosts');

    Why won't this work?

  2. ConnorP
    Member
    Posted 1 year ago #

    anyone?

  3. olavxxx
    Member
    Posted 1 year ago #

    Have you tried setting it in your admin area under reading? There is a limit number of posts for posts pages setting there.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags