Creating related post in Oxygen Builder using the custom query and easyposts

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
we're going to have a look at creating the related posts and you'll see that as i go through each post the post that we're looking at is not repeated in the list of related posts and even though we have more than four posts there is no pagination being displayed with the related posts either so to have a quick look at that setup we head over into oxygen you'll see here's my related post module and what we'll do then just see how that sets up so first of all we'll just look at the query and in the query we've used the advanced setting so under advance you have custom settings and we'll have a look at that query so we basically said the same post type the current post id not in the list of posts to be displayed in the related post loop and then also the number of posts per page is three what we also then did is just use some css and what we did in the css is just hide the pagination but what we'll do is recreate this loop so you can see exactly how that's set up so once we in our section here we've put in the title related posts we'll now head over to easy post we'll add easy post and the first thing i'm going to do is just change the layout to a more standard layout just makes it easier to see what we're doing so we're just going to go with the grid image standard and immediately you'll see that this is what's displayed and we'd like more posts so we head over then to the query select advanced in advanced we're going to say posts of the same post type as the current and the moment that we do that you'll see that all the posts come through including the post that we're looking at so what we want to do now is start eliminating that from happening so we already have made sure that we're in the same post type now we're going to add a parameter here and we're going to say we know that it's going to be post underscore and we look for post not in there we have post not in and we add the value and we look now for the id because we don't want the post id and under advanced we see the post id we just add that parameter and we can save that and now if we apply that query you'll see that the post that we're currently looking at won't be in the list so now we're down to four but we really only want three in our list so we're going to go back in to edit that query i'm going to add a parameter and the parameter that we're going to add here now is going to be posts so we look for posts per page and we add a value and we say that the post per page will be three and we close that and now when we apply the query terms you'll see that we're down to three but we have this pagination at the bottom here which we don't want so i'm going to save that i'm then going to head over to my post i'm going to refresh and you'll see the uh well two things you'll see the pagination and then you'll also see that this excerpt makes it a little bit untidy so what i'm going to do then is just inspect that pagination at the bottom of the page and you'll see it's oxi easy posts pages and we're just going to add that here on the right and then we're going to say display none and that'll get rid of the pose so then i'll copy that i'm going to head back here into the layout and then i'm going to go over to the different templates and i'm going to go into template css and i'm just going to hide that then apply the code and you'll see that that's no longer visible the next thing that we need to do is just change the layout to remove the excerpt and here we see the excerpt here in the template so first thing i'm going to do is comment out the html the div tag and then the next thing i'm going to do is just cop comment out the excerpt so if i wanted to use that information in the future in this particular layout it's still there to be used so there we have it we've now removed those items and now when we head back to the website and we refresh you will see that we have our post and we have our related posts and the post that we're looking at is not visible and there also isn't any paging with the related posts right so that's how easy it is to add the related posts to an existing post to hide the pagination and also to make sure that the post you're looking at is not in the posts that fall under related posts so thank you for watching
Info
Channel: Bruce Young
Views: 139
Rating: undefined out of 5
Keywords: oxygen builder, related posts, oxygen custom query
Id: R3BTF6gz6gY
Channel Id: undefined
Length: 5min 19sec (319 seconds)
Published: Mon Nov 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.