Lately, one in every of our customers requested us if there was a solution to present related pages as a substitute of posts in WordPress. Beforehand, we confirmed you easy methods to present related posts in WordPress with or with out plugin. On this article, we’ll present you easy methods to present related pages in WordPress.
Displaying Related Pages in WordPress Utilizing Plugin
The simpler solution to show related pages in WordPress is by utilizing a plugin.
Very first thing you should do is set up and activate the But One other Related Posts Plugin (YARPP) plugin. After activation, you should go to Settings » YARPP to configure the plugin.
On the plugin’s settings web page, scroll all the way down to ‘Show Choices on your web site’ part. Underneath Robotically Show possibility, you should examine ‘pages’ and depart posts and media unchecked. That’s all, it can save you your settings now and YARPP will begin displaying related pages beneath web page content material in your WordPress web site.
Please be aware that YARPP together with another WordPress plugins is blocked by some managed WordPress internet hosting suppliers resulting from its heavy database utilization. One other problem that you could be face is that YARPP can’t search database for textual content in case your MySQL storage engine is about to InnoDB.
Displaying Related Pages in WordPress With out Plugin
Earlier than we present you easy methods to show related pages with out utilizing a plugin, we wish you to check out our article on the distinction between Posts and Pages in WordPress.
Best solution to show related posts is by on the lookout for tags or classes. However since WordPress pages should not have tags or classes, we’ll first have to allow classes and tags for WordPress pages. To try this, all you should do is set up and activate, the Put up Tags and Classes for Pages plugin.
The plugin works out of the field, so there usually are not settings so that you can configure. Upon activation, it would merely allow tags and classes on your WordPress pages.
Now you should edit a few pages you assume are related to one another and add tags. For instance, if in case you have a web page about your organization and one other web page for firm’s historical past, you’ll be able to tag them each as about us.
After you have got added tags to some pages, the subsequent factor you should do is so as to add this code in your theme’s features.php file or a site-specific plugin.
This code appears to be like for tags related to a web page after which runs a database question to fetch pages with the same tags. To show the listing of pages, you would want to edit your web page template. Mostly it’s
web page.php or
content-page.php file. Merely add this line of code the place you need related pages to look.
This may show related pages on any WordPress web page. It won’t look very fairly at first, so you’ll need so as to add some CSS and elegance it to match your theme.
Observe: code in features.php are handled the identical as plugins.
You May Also Like : How to Display a User’s IP Address in WordPress