Learn how to display first a particular Custom Post Type (CPT) entry in WordPress search results with this tutorial.
Following a request from a subscriber, I prepared a tutorial to choose the order of appearance in the search results when using Relevanssi Plugin.
But if you’re not using the Relevanssi plugin, you can also get the CPT you want to display first in WordPress search results with this code tutorial.
Snippet to prioritize a CPT in WordPress search results
Add the following code at the end of functions.php or in your functionality plugin:
To see this and another 919 code snippets of this website, login or subscribe here.
In this case you are prioritizing the portfolio entries, but you can change it to the CPT of your choice.
Conclusions
Now you know how to get entries from a particular CPT to be prioritized in WordPress searches.
Any questions? Let me know in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉