• Resolved zdukenukem

    (@zdukenukem)


    Hi,

    I have lots of articles on my site and it takes lots of time to load.
    Is there any way to define smaller number of articles occuring on front page?

    In Settings/Reading I have set that front page is showing my latest posts and defined that blog shows at most 10 posts.

    I am using child theme, and I tried to define hook in functions.php
    but it it works fine one every other page but front page.

    Even tried with your recipe to show only particular category on front page but no luck.

    Thanks

    Zduke

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi -@zdukenukem

    In Setting -> Reading you can restrict your value to any number you want.
    For e.g: if you want only 5 post to display in front page you can set blog post at most to 5.

    Thank You!!

    Thread Starter zdukenukem

    (@zdukenukem)

    Tried that but it simply wont work on front page ??

    Thread Starter zdukenukem

    (@zdukenukem)

    Resolved!

    Copied index.php into child theme.

    Right after:

    <?php do_action('frontier_before_loop'); ?>

    and in front of the main loop I inserted:

    <?php global $query_string; global $wp_query;
    
    $args = array_merge( $wp_query->query_vars, array( 'posts_per_page' => '10' ) );
    $posts = query_posts( $args ); ?>

    And then after the main loop I put:

    <?php wp_reset_query(); // reset the query ?>

    Front page now shows only 10 posts ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cut down number of articles on front page’ is closed to new replies.