In WordPress, The homepage shows only posts by default which belongs to the post type “posts” and that’s what sometime we don’t only want.
But also, we want to display some posts from the custom post type. It might be products, services etc.
Below are the solution for you:
Display Posts from Custom Post on Homepage
Take a look to the below code that we have embedded first and just change the post type from services to something else you want.
Code Snippets (Line of code that Need to change):
Also you can add more than 1 custom post type by just putting comma.
Now the main codes are below embedded, Just copy it and paste it into your WordPress theme‘s functions.php then save it.
Code snippets for Display Custom Posts on Homepage
See the changes by opening Home Page.
Note: The code is 100% working, If you face any error let us know in the comment box.
Don’t forget to share this Display posts from custom post type on HomePage.