How to Split WordPress Posts into Multiple Pages

hedgehog mascot

Sometimes posts tend to get a bit out of hand regarding their length for various reasons. That’s when it is time to split WordPress posts into multiple pages. It is easier for users to focus on two post pages which are both short than on one really long post. WordPress has a simple way of achieving such improved user experience.

The Tag

You can split your post into as many pages as you wish. Just add the following tag into your post where you want to create the split:

Everything after the tag will be on the next page of your post.

The Code

Some WordPress themes already have an inherent way of dealing with split posts.

But some themes will not support post splitting right away. When you add <!––nextpage––> to your post and nothing happens, you will know that your theme needs a little coding. If this is the case, go to your WordPress dashboard and click Appearance > Editor. Find the single.php and content.php files in the right pane and check whether they contain the following line of code:

Single.php only deals with your posts. It contains the definitions of the way your single posts should be handled. Content.php is the default template for displaying content on your site.

After you made sure that neither file contains this code or a variation of it, add the above line of code below the lines of code that deal with your site’s header and sidebars. There is usually a line of code that clearly identifies the content part of your post. That’s where the above line of code belongs.

The Look

By default, i.e. using only the above mentioned line of code, your pagination will list your pages as Page 1, Page 2, Page 3, and so on.

If you are not satisfied with the look of your post pagination and would like to change it, you will need to fiddle with the code a little bit. Like this:

In the second line of the code I defined that the post pagination links should be aligned to the right. I also defined that the links should be formatted using CSS, specifically the pagination and pagelink classes.

Now you can set the look of these two classes in your WordPress dashboard by clicking Appearance > Edit CSS. This is where the CSS Stylesheet Editor can be found.

To change the positioning and color of my post pagination links, I use:

split WordPress posts pagination look

Pagination look

The final look of the links is quite nice and works well with the overall design of the site.

Final Thoughts on Split WordPress Posts

Do you split WordPress posts into multiple pages? Did your theme support it originally or did you have to add some code? Did you have trouble making your post pagination look nice with CSS? Let me know in the comments section below.

Liked this post?

Subscribe to our newsletter to receive early notification of new posts and deals:
[mc4wp_form id=”45″]

Next Post »« Previous Post