From the course: WordPress: Custom Post Types and Taxonomies

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Displaying the custom loop

Displaying the custom loop - WordPress Tutorial

From the course: WordPress: Custom Post Types and Taxonomies

Start my 1-month free trial

Displaying the custom loop

- [Instructor] With our custom loop function defined, it's time to add that to our templates. Let's go ahead and copy the lil show events function, and then we're going to open up our content single business file in template parts content. Right before the end of the entry content div, we're going to place our custom code. So the first thing we'll do is create a section with the class related events. We'll close that section so we don't forget to later. And then we will add our content. So we'll create a heading three tag, and we'll print out a heading using the internationalization function, so we'll open up our php tag, underscore e, upcoming events, and then our text domain will be twentynineteen. We'll close the php tag, and then we'll close the heading three tag. And then, we will call our lil show events function. And since we do all of the printing inside of that function, we don't have to worry about printing it here, we can just add the function call. So let's save that, and…

Contents