Shop WP.blogspot.com

Present Associated Pages in WordPress

 Present Associated Pages in WordPress

Just lately, one in all our customers requested us if there was a strategy to present associated pages as a substitute of posts in WordPress. Beforehand, we confirmed you how you can present related posts in WordPress with or without plugin. On this article, we are going to present you how you can present associated pages in WordPress.

Exhibiting Associated Pages in WordPress Utilizing Plugin

The simpler strategy to show associated pages in WordPress is by utilizing a plugin.

Very first thing it is advisable do is set up and activate the Yet Another Related Posts Plugin (YARPP) plugin. After activation, it is advisable go to Settings » YARPP to configure the plugin.

Configue YARPP to only show related pages

On the plugin’s settings web page, scroll all the way down to ‘Show Choices to your web site’ part. Below Routinely Show possibility, it is advisable examine ‘pages’ and depart posts and media unchecked. That’s all, it can save you your settings now and YARPP will begin displaying associated 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 hosting suppliers attributable to its heavy database utilization. One other situation 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.

Exhibiting Associated Pages in WordPress With out Plugin

Earlier than we present you how you can show associated pages with out utilizing a plugin, we want you to check out our article on the difference between Posts and Pages in WordPress.

Most effective strategy to show associated posts is by on the lookout for tags or categories. However since WordPress pages should not have tags or classes, we are going to first must allow categories and tags for WordPress pages. To do this, all it is advisable do is set up and activate, the Post Tags and Categories for Pages plugin.

The plugin works out of the field, so there usually are not settings so that you can configure. Upon activation, it's going to merely allow tags and classes to your WordPress pages.

Now it is advisable edit a few pages you assume are associated to one another and add tags. For instance, when you've got a web page about your organization and one other web page for firm’s historical past, you possibly can tag them each as about us.

After you've gotten added tags to some pages, the following factor it is advisable do is so as to add this code in your theme’s functions.php file or a site-specific plugin.

perform wpb_related_pages() 

This code seems to be 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 wish 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 associated pages to seem.

<?php wpb_related_pages(); ?> 

This can show associated pages on any WordPress web page. It is not going to look very fairly at first, so you will have so as to add some CSS and magnificence it to match your theme.

Be aware: code in features.php are handled the identical as plugins.

We hope this text helped you show associated pages in WordPress. As at all times, please be at liberty to ask us questions within the feedback beneath. Don’t neglect to follow us on twitter or be a part of the dialogue on Google+.

Tutorials