I'm making a website and want to display Events. Therefore I made a Custom Post Type called 'event'.
I'm querying events to show them in a page. The Events I made also have some custom fields like : 'Location', 'Day', 'Month', 'Year' and a category.
This is my code now :
<?php
$args = array(
'post_type' => 'event',
);
$events = new WP_Query( $args );
if( $events->have_posts() ) {
while( $events->have_posts() ) {
$events->the_post();
?>
<div class='event'>
<div class="event-date">
</div>
<div class="event-content">
<div class="event-title"><?php the_title() ?></div>
<div class="event-info">
<span>Location: </span>
<span>Category: </span>
</div>
</div>
</div>
<?php
}
} else {
echo 'No events!';
}
?>
Which only gives me the title. How can I display the custom fields and the category ?
I am fairly new to WordPress development, used to programming in .NET.
Thx for any help!