one thing I don’t like about WordPress out of the box is the fact that when you do a search on your website it displays search results for posts which is good but it also displays search results for Pages which doesn’t always make sense so let me show you what I mean by this when we do the search on my website for let’s just say Tony cuz this is a good example we return our block close down here which looks really great cuz they all have their future damages and everything but when you see up here that you have my about page and my contact page and I don’t even know what this is it’s probably cuz I’m logged in but that’s just not something we want we just want to show our blog post had a grid like this as our search results so

we can fix this with a custom function a custom Plug-In or like I recommend doing in a child theme in a functions.php file if you don’t have a child thing for your WordPress website I’ll show you how to do that in one of my other videos up here but if you do you’re good to go otherwise just watched a video first and come back here to catch up with us at Oriel so what we’re going to do is go into our dashboard and go to appearance theme editor now like I said you can actually edit your theme directly which I don’t recommend I recommend you doing it in a child in because there is minimal risk of screwing something up cuz when you work with the the main theme Here you might screw things up if you don’t know what you’re doing so

what you want to do is do that child named make sure that selected in going to the functions.php file a couple of lines below the last line in the file and then type in this code I’ll have this link down below for you so you don’t have to type it in actually could just copy and paste it and also down in the description I’ll have a link to generate press which is the theme that amusing here I think that I use across all of my website so I mean if you sign up for that it’s a premium team so if you sign up for it I’ll get a small kick back from the company for promoting their products so thanks in advance if you go ahead and do that basically what we’re going to do here is a filter out all posts that are I guess all pages that aren’t posts and only display them in the search results I’m not going to be 10th at 8 exactly understand what’s going on here but the point is that it works and all we have to do is type it into our functions.php file so once you have it in there go ahead and click on update file

phyletic successfully which is good let’s go to our website again and do another search for Tony

and this time we don’t see those pages will be just your blog posts just like we want it so that is it that is what we wanted to do at the beginning of this video we had done it not too bad right just pissing in a couple pieces of code there it does what we wanted to do thank you guys for watching this video if you like to give you a thumbs up if you really liked it subscribe and if you do I’ll see you in the next video

Origin Ten  Ltd,
Queens House
200 Lower High Street
Watford
WD17 2EH

Stay tuned

Exceptional quality. Ethical factories. Radical Transparency. Shipping and returns.

    Privacy Preference Center