Reputation: 1
I got a Custom Post Type Page, this is the code I use:
<?php
get_header();
get_sidebar();
the_meta();
?>
<ul class="event">
<?php $args = array( 'post_type' => 'event-netzwerk', 'posts_per_page' => 30, 'orderby' => 'rand' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
echo '<li>';
the_title('<h3>', '</h3>');
the_content();
echo '</li>';
endwhile; ?>
</ul>
<?php
get_footer();
?>
Does anybody knows how I can add an AFC there?
Upvotes: -1
Views: 78
Reputation: 161
You can use the_field function.
the_field("your_custom_field");
https://wordpress.org/plugins/advanced-custom-fields/screenshots/
Upvotes: 1
Reputation: 4110
To display ACF in your theme use the_field()
<h1><?php the_field('custom_title'); ?></h1>
Upvotes: 1