• Resolved viniciusmaroli

    (@viniciusmaroli)


    Hi, I am having a problem with the post grid block. The max of posts that the grid show is 100, I would like to show more.

    Is it possible?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Hey @viniciusmaroli,

    If you’re comfortable with PHP, you can use the themeisle_gutenberg_posts_block_query filter that is a part of Otter to override the query and increase the number of posts.

    This will, however, change things for each and every Posts block that you use (unless you add certain conditions or checks depending on your website).

    We wouldn’t recommend loading too many posts as it can slow down your website, specially if you’re also showing images.

    Thread Starter viniciusmaroli

    (@viniciusmaroli)

    Thank you Hardeep, how can I use the themeisle_gutenberg_posts_block_query? I only have one post block, so there won’t be too many problems.

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Hey @viniciusmaroli,

    You can use something like this:

    function increase_post_count_otter( $params ) {
    	$params['numberposts'] = -1;
    	return $params;
    }
    
    add_filter( 'themeisle_gutenberg_posts_block_query', 'increase_post_count_otter' );

    -1 tells WordPress to show all the posts. You can also set it to a specific number.

    Thread Starter viniciusmaroli

    (@viniciusmaroli)

    Thank you very much Hardeep, where I put this code? On the functions.php file?

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    If you do that, the changes will be gone as soon as you update your theme. You can try using a plugin like https://ww.wp.xz.cn/plugins/code-snippets/ to add custom PHP.

    Thread Starter viniciusmaroli

    (@viniciusmaroli)

    Hardeep, I will be forever grateful. Thank you very much!!!

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Let me know if it worked for you.

    Thread Starter viniciusmaroli

    (@viniciusmaroli)

    Yes! Perfectly

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Awesome. Let us know if you ever have any issues with Otter. Have a great day ahead!

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

The topic ‘Post Grid’ is closed to new replies.