Create a Related Posts Section in Oxygen Builder

Published by Justin on August 29, 2022
Last Updated: August 29, 2022 | Reading Time: 2 minutes

When building your blog in Oxygen, you may want to add a related posts section. This is particularly useful if you want to increase page views and keep people engaged on the related content on your site. There are a few different ways to create a related posts section in Oxygen Builder. In this post, we'll show you how to use the custom query and easyposts widgets. This method also doesn't require any additional plugins.

Set up a Custom EasyPosts Query

To set up a custom query, you'll need to add an easyposts widget. Then, click on query -> advanced. When you edit your query you'll be adding 5 parameters:

ParameterValue
Post & Page -> post typedata -> advanced -> post type
Post & Page -> post__not_indata -> advanced -> post id
Pagination -> posts_per_page3
Caching -> no_found_rowstrue
Taxonomy -> tax_queryAn array with 3 values:

taxonomy -> category

field -> slug

terms -> add value -> data -> 'post_terms' taxonomy='category'

Once you set this, feel free to adjust the number of posts to display and other styling options.

Create a Randomized Posts Widget in Oxygen

If you don't want related posts, but want to show a selection of random posts, you can do that too. This is great for keeping people engaged on your site and looking at other content they may not know they'd be interested in.

To do this, delete the taxonomy parameter (with the 3 array values) and add another parameter. Now, every time you refresh the query (page) it will show a different set of posts.

Order -> orderbyrand

Conclusion

And that's it! You now know how to create a related posts or random posts widget in Oxygen Builder using the custom query and easyposts widgets. If you have any questions, feel free to leave a comment below.

Written by Justin
Justin is the founder of Gold Penguin, a web design and marketing agency that helps businesses achieve their online goals. Justin has a passion for web design and marketing, and he loves working with clients to help them grow their businesses.

Comments

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
Made with 💛 by Gold Penguin © 2022