Wordpress display custom post type on homepage

Just to recap, we created a custom post type called Podcast, and a custom taxonomy — Podcast Category.

In this guide, we will discover 3 ways you can display articles from the Podcast post type on your website. Before trying these methods, make sure you have at least 1 articles published under your CPT. But if you changed the permalink structure to display links in more SEO and user friendly manner, your post type URL can look like this: www.

Depending on your setup, you need to get this link, and add it in your menu as a custom link. Change example. The next time you open your website, you will see Podcasts on your menu. If you click on this link, it will display the articles from Podcasts post type using the default archive. All you need to do here, is create a file called archive-podcasts. If such file exists, WordPress will automatically use this template file when displaying content from your custom post type.

A good practice is to copy the contents of archive. Another thing you can do, is to create a custom template for your single entries. By default, WordPress uses single. Similarly, you can create a file called single-podcasts.

This comes in handy when you have custom fields or taxonomies. To get started, you can copy the contents from single. A more advanced approach when dealing with custom post types, is to display them alongside other types of content on your front page.

In our example, this would mean to display podcast and blog posts together on the landing page.

wordpress display custom post type on homepage

By default, WordPress uses a template file called index. This is an example of how a simple index. You need to add the following piece of code after the main WordPress loop in your index. This is how we query the WordPress the database, and load articles from custom post types on the landing page.

Two things are important here: 1. More info on this function can be found here. This way, when the theme updates, you pathway capital management salary to keep all your changes.

WordPress Tutorials

Need help with your WordPress Project? Hire an experienced developer today!There are number of attributes that you can use with the provided shortcode. The following people have contributed to this plugin. View support forum. Donate to this plugin. Skip to content WordPress. Used most often for Pages Features of Display Custom Post WordPress Plugin: It provide you ready-made grid layout for your every custom post, you may simply have to put shortcode.

It is mobile responsive as well. You may also put number of posts to be shown, order, orderby etc in shortcode.

Please see attributes list above. Screenshots Plugin setting page Shortcode added on any wordpress post or page Custom post layout Mobile responsive. FAQ How can I display all posts on a single page without pagination? How to show custom posts associated with custom taxonomies? Please wait for the next release. It is a good plugin indeed for custom post grid display.

Looking for its new version in which maybe you will add taxonomies support as well. I had dobut as it is new plugin but it work like a premium plugin. Lightweight and easy to use and responsive custom post grid. Thank alot plugin team. Contributors Vikas Kumar. Interested in development? Changelog 1. Meta Version: 1. Ratings See all. Log in to submit a review. Support Issues resolved in last two months: 0 out of 1 View support forum.

Donate Would you like to support the advancement of this plugin?Want to level up your WordPress knowledge?

They make WordPress so much more powerful. I struggled with a lot of poor solutions until I finally found one that let me, a non-developer, both create and display custom post types on the front-end of my WordPress sites. And now, I want to share how to do that with you. Ok, this topic deserves a whole post of its own.

Plugins use them all the time. For example, you might have a plugin that helps you manage events or display real estate listings. Basically, custom post types are what make WordPress an all-purpose CMS, instead of just a blogging platform. Creating a custom post type is fairly trivial. Doing it with PHP is simple, but there are also plenty of plugins that can help you create a custom post type. I think I have a love affair going on with Pods.

Then, head to the new Pods Admin link on your sidebar and click the Create New button:. Give your Custom Post Type a singular and plural label.

And… you just created a custom post type. Look at your sidebar, you should see a new option for Movies:. For the first one release dateyou need to make it a date field:. Ehhhh, one problem. See, you have those fields on the backend, but even if you add the fields like this:.

wordpress display custom post type on homepage

Where did your custom fields go off to? They seem to have been misplaced. Ok, so to get the ability to do this without any complex code, you need to enable the Pods Templater. Magic tags are what allow you to display your custom fields on the front-end without needing to know any PHP. So if you create a magic tag for the Director custom field, it will show the actual name on the front-end. First, select your Pod Reference this is the custom post type you want to pull data from.This custom post type tutorial is a follow-up to our earlier article showing how to create custom post types for WordPress.

Let's imagine that you're now empowered by knowledge and have gone wild, creating lots of new custom post types. They work wonderfully, but by default they don't show on your homepage. So, how do you get these custom post types to show on the front page of your blog with the normal post types? There are a couple ways to do this, neither very difficult. Trying them both will give you practice editing functions. In method one, we'll show you where to find the functions.

In method two, we'll be pasting a few lines of code in the The Loop, found at the top of the default index. On the right side of the page there is a list of files. Scroll down and find Theme Functions and click on it.

How To Create And Display A Custom Post Type On WordPress

This will open the file in the editing window. After you paste it, change the array to a list of your content types. Type the names between single quotes 'name' separated by a comma, no comma after the last one in line.

You could also make the changes in a text editor before you paste it. Don't delete any brackets or punctuation or add any stray marks. At one point in WP 3.

That did not happen for me. Even so i am going to include a second method in case you run into problems. This will also introduce you to The Loop, which is often modified by theme developers and you may need to tweak it at some point. The Loop is used by WordPress to display each of your posts.Custom post types are a big part of what moved WordPress from a blogging platform to a full-fledged content management system that can be used to build any type of website.

For example, WooCommerce products are custom post types. Or the actual event listings in an event calendar plugin are also a custom post type. If you search the WordPress. To get started, all you need is Pods installed and activated on your website.

wordpress display custom post type on homepage

The whole process looks like this:. Then, enter a singular and plural label. You just created a custom post type. You should notice a new Coupons option in your dashboard sidebar or whatever label you used :. Not just a regular WordPress post. To make that easier, you can use something called a custom field. A custom field is an extra input area that shows up in the WordPress editor.

For this example, three helpful custom fields would be:. To add a custom field, all you need to do is click Add Field in the Pods interface:. That will open up a new set of settings. First, give the field a Label. Then, use the Field Type drop-down to select what type of field you want to add:. Repeat the process for as many fields as you want to add. Then, you should see something like this:.

You should see those new custom fields hanging out underneath the regular WordPress editor:. WordPress will output the regular WordPress editor fields for your custom post type. Most custom post types plugins stop here and make you do the rest using PHP.

wordpress display custom post type on homepage

But Pods actually gives you an easy way to get your custom fields to display on the frontend of your site. Pods includes a helpful feature that lets you create a custom template for your custom post type using regular HTML and magic tags, rather than requiring you to create a template using PHP. You should see a code editor:. When you select your custom post type from the drop-down, it will show all the available fields, including the custom fields that you added:.

Then, you can select the field from the autosuggestions:. Note that you can:. If you want to create an archive page to list all of your different coupons rather than just the page to list a single coupon like I showed you aboveyou can create a new template to control what information displays on the archive page.

Then, follow a similar process to force your custom post type to use that in the Auto Template Options. If you want to add a taxonomy to your custom post type like a tag or a categoryyou can use Pods to create a new taxonomy by going to Add New and selecting Custom Taxonomy from the drop-down. Then, you can associate that taxonomy with your custom post type by using the Built-in Taxonomies section in the Advanced Options tab of the Edit Pod interface:.

Custom post types are one of those things that open up a whole new world for building sites with WordPress. But for now, you should have a solid grasp of what it takes to create your own custom post type and actually display it on the frontend of your site. And to take things even further, you might want to check out our other posts on how to use ACF to create a portfolio siteor how to start learning WordPress development.Hello there. I copied the code from single.

But I cannot see the post display in my locally hosted site. Please help me how to make it work. I hope I am editing the right file. Thank you in advance. Code I am using is:. Hello Upadesh, if you wanna create a custom post type, I would recommend to switch first to a WP standard theme, like Twenty Seventeen.

If you still want to programm your own CPT, please ask on stackoverflow or another wordpress forum for developers. As you suggested, I was able to make the post display the title and description, but there are still few of the custom fields that I want to display in the post. Rename it, to fit your custom post type, i. Dear cafeserendipity21, You are great. It worked like a charm :. I am in love with your theme and waiting for the future update of the theme.

I hope we will soon get this theme with Bootstrap v4 final release. Skip to content WordPress. Skip to content. Resolved Upadesh upadeshs 2 years ago. Viewing 4 replies - 1 through 4 of 4 total. Theme Author cafeserendipity21 cafeserendipity21 2 years ago. Upadesh upadeshs 2 years ago.

Dear cafeserendipity21, Thank you for the help and I am great fan of your theme. I tried same with the Twenty Seventeen Child theme and it worked.

A Complete Guide to WordPress Custom Post Type For WordPress Beginners!

Thanks in advance once again. In: Themes and Templates 4 replies 2 participants Last reply from: Upadesh Last activity: 2 years ago Status: resolved.While WordPress is used and known mostly as a blogging platform, what most people miss out is that WordPress is a robust and advanced Content Management System that is used by various companies and individuals all over the world. Gaining a foothold in the game, WordPress now enables the users to create a wide variety of content other than the default posts and pages.

These custom contents that we can create is known as the WordPress Custom Post type. And to give our users an insight into what exactly does it mean and how do we generate these post types, we have indulged ourselves in this thorough article!

Display Blog Posts on Front Page WordPress

A simple definition of the Custom Post Type would be Content types like Posts or Pages that you can customize and add to your preference. They are very much like any normal posts. This means that unlike the default values like page, attachment, and post, the MySQL databases display a different value for them. By default, WordPress provides several post types that are readily available for the users when you install.

For the convenience of our users and a clear understanding, we have explained in a line or two about each Post Type. Pages: This is similar to post but does not follow the time-based listings of posts. This can be organized in a structure with parent pages but they cannot be assigned to categories and tags. Attachments: This is a special kind of post that holds the information about a specific file uploaded with the WordPress Media Upload system.

This includes any description, title, metadata information and so on. Revision: This Post Type holds draft posts as well as the revisions made to specific posts. Navigation Menu: This holds the information about a single item placed on the WordPress nav menu system.

To give you an excellent example for you to understand the importance of CPT, imagine that you own a website that deals with reviewing products. While the reviews can be contained in a single blog post, there might be elements that you wish to change. For instance, you might wish to display the brand and the location of the product in a more striking and prominent manner.

This even enables the users to access and search for the product by these taxonomies. Imagine that you need to add a Buy Now Button somewhere on the post to send interested visitors to the site. While the default Featured Image section works with most posts, you might come across times when you want to change the default layout structure.

Sounds like a ton of customizing and modifying right? This is where custom post type or CPT comes in handy. With these, you can easily create a post type that you prefer and meets your requirements. It includes custom fields where you can add elements that you need.

If you wish to remove any meta information, you have the option for it as well. Modifying is much easier and takes lot less time compared to the other method. This is an easier alternative to creating a WordPress custom post type for beginners and novice. Rather than going through the whole process yourself, let a plugin do the job for you. Provide the name for the custom post type.

This field has a limit that cannot exceed more than 20 characters. The next field is for the label for your WordPress custom post type.