php - Wordpress pagination not visible from loop

588

I'm doing a blog with Wordpress and the post pagination doesn't appear. The post list is shown correctly, but there is only 5 post (I have 8) and pagination isn't working.

9

Answer

Solution:

You maybe didn't set anyposts_per_page value and the default is 5. If you want to modifiy it for the whole website blog/archive pages, modify the posts_per_page value in the Reading Settings page.

In a$args array, modify as folow:

$args = array(
   'posts_per_page'=> -1, // unlimited
   'category' => ''
);
$posts = get_posts($args);

I'm prudent with my answer (that why I give 2 methods to achieve this), because I don't know with your given code, if the main loop $args is modify.

I hope this could nevertheless help you.

People are also looking for solutions to the problem: php - Custom hasMany Relation Laravel

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.