WordPress.org

Support

Support » Themes and Templates » Limiting the amount of posts on a page

Limiting the amount of posts on a page

  • 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?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limiting the amount of posts on a page’ is closed to new replies.
Skip to toolbar