• I want to display 24 recent post on the home page and all the post on another page 24 post a page for this how would I go about doing this??

    • This topic was modified 2 years, 9 months ago by DJboutit.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @djboutit If you are using Gutenberg editor then please use “latest post” block and set 24 count in it. If not then use the following code.

    <?php 
       // the query
       $the_query = new WP_Query( array(
         'category_name' => 'news',
          'posts_per_page' => 24,
       )); 
    ?>

    You can exclude 24 posts from the following code.

    query_posts('posts_per_page=6&offset=24');
    if ( have_posts() ) :
    while ( have_posts() ) : the_post(); 
    endwhile;

    Please let me know if you have any questions.

    Thread Starter DJboutit

    (@djboutit)

    Show where do I add these codes??

    @djboutit Can you please confirm what editor are you using?

    Thread Starter DJboutit

    (@djboutit)

    I like classic editor I can switch to Gutenberg for something

    lisa

    (@contentiskey)

    if you prefer to keep working with the “classic editor” instead of using the built-in blocks editor – try a plugin like this: https://wordpress.org/plugins/display-posts-shortcode/

    (I have used display posts plugin on my client sites that don’t want to use the built-in blocks editor – the display posts plugin seems well documented)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Show Recent Post On Homepage All Other Post On Another Page’ is closed to new replies.