The Previous and Next block A piece of a page, such as a paragraph, a picture or a button. In WordPress you build a page by putting blocks one after another. puts two cards at the end of a post. One links to the post before it, and one to the post after it. WordPress finds the two posts, so you type nothing, and the links stay right when you publish more. See it working on the Previous and Next page.
Add previous and next links
Add the Previous and Next block at the end of a post.
Look at the two cards in the editor. They show the real posts on each side.
Type your own words over Previous and Next on the cards, or leave them. To remove a label, delete its text. The arrow stays.
Pick the settings you want in the Settings tab.
If a side has no post, the editor shows a dashed note. “No post on this side, so the page shows nothing here.” means the page shows only one card.
To have the block on every post, put it in your post template, or in a saved block that you place in your posts. Many themes The design of your whole site: its fonts, colours and where the menu and footer go. You pick it under Appearance, then Themes. draw their own previous and next links further down the same page, and Twenty Twenty-Five is one of them. If you add this block, you may want to take the theme’s links out of the template.
The settings
The Previous and Next panel lists, in this order:
- Stay in: All posts to start, then The same: Categories, The same: Tags and any other grouping your posts have. With a category, the block skips the posts between that are not in it. A post in two categories counts neighbours from both, which is WordPress’s own rule.
- Skip posts hidden from search: on to start. It leaves out posts you marked noindex in your SEO plugin An add-on you install in WordPress to give your site new features. Gillish Cairnstone and Gillish Core are plugins., such as a thank-you page.
- At the first and last post: see below.
- Just Previous and Next: off to start. See below.
- Look: A box to start, or Text alone. See below.
- Where: In the text to start, In the page margins or At the edges of the screen. See below.
- Picture: Small beside the text to start, Large above the text or No picture. It is the post’s featured image. A post with none just has no picture.
- Show the date: off to start.
- Show a few words of the text: off to start. It shows 16 words at most. On a phone the words stay out, to keep the cards short.
- Arrow: Arrow to start, Chevron or None. Each points outwards.
- Swap sides: puts the next post first. The order changes for a screen reader A program that reads the screen aloud, for people who cannot see it well. They move around the page with the keyboard and hear what is there. too.
- Title as heading: Not a heading to start, or level 2 to 6. It is for screen readers and search engines, and it does not change the size.
At the first and last post
The newest post has no post after it, and the oldest has none before it. You choose what happens on that side:
- Show nothing on that side: the start. The page shows one card and no empty box.
- Go round to the other end: the first post links to the newest, and the last to the oldest.
- Link to all posts: the card links to your list of posts. Type its text on the card. It starts as All posts.
Plain links, and links outside the text
The links need not be two big cards inside your text.
- Just Previous and Next shows two plain links with an arrow, with no title or picture. Picture, the date, the text and Title as heading then leave the panel.
- Text alone takes away the box around each card.
- In the page margins puts the links beside your text, 16 pixels from it.
- At the edges of the screen puts them 16 pixels from the window’s edges, and they stay there while the page scrolls. They look as they do anywhere else in the block, and your colours in the Styles tab apply. With Text alone they have no box, so what scrolls under them shows through. If a link lies over something, such as a menu item, a press opens the link, and a small scroll frees the item under it.
The two choices under Where show on the page, not in the editor. Where a side has less than 120 pixels free, as on a phone, the links stay in the text. They stay in the text with no script too.
The block measures the window, not a sidebar. On a theme with a sidebar, the margin choice can land on it. If it does, pick another choice.
How it looks
With nothing set, each card has a thin line in the page’s text colour, no fill and 10 pixel corners, so it works on a light and a dark page. The whole card is the link. Hover gives the card a soft wash and underlines the title. A title takes four lines at most.
The two cards sit side by side. When the block is 480 pixels wide or less, they stay side by side and get short: the small picture and the few words go, and a title takes two lines. A large picture stays. They go one above the other only under 220 pixels. That goes by the block’s own width, so it works the same on a phone and in a narrow column.
To style it, open the block in Cairnstone → Blocks. Pick Card, Label or Title beside Style: above the block, then set the colours in the Styles tab. In that view the panel says the cards are a sample of your two latest posts. On the page, each post shows its own neighbours.
Good to know
- A screen reader finds the two cards as one group named Posts. It reads each card as its label and title, such as “Previous: Show what customers say”, with no arrow and no picture. Each card is one Tab stop. A title set as a heading is read as a heading. With Just Previous and Next, it still says each link’s label and the post’s title, and each link is one Tab stop.
- In the text, the block loads no script. Outside the text, it loads a small one.
- It draws nothing on an archive page, and nothing in a saved block’s own preview.
- The arrows mirror on a right-to-left page.
Next, read Show your opening hours.