How to get data from ACF ???
-
Hi everyone !
I use Underscore for develope my theme.
I have created 1 custom post type named “Video” and 1 custom taxonomy named “Cate”, and i created some terms in this.
I created a file named “video-cat.php” to list all video in term, and i want to show the Slider and the Featured Image at the top of that term
( 1 Slider and 1 Featured Image per 1 tearm )I created 2 fields in ACF to input Slider and Featured Image with Rule
– Taxonomy Term is equal to “my custom taxonomy “.Everything look good, i can input Slider and Featured Image per term in my custom taxonomy at DASHBOARD
But I don’t know how to show this field in front end .
This is my code
archive.php
<?php get_header(); ?> <?php the_field('cat-featured-img'); ?> <?php the_field('metaslider-id'); ?> <?php get_template_part( 'video/video', 'cat' );?> <?php get_footer(); ?>video-cat.php in folder video
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php the_field('cat-featured-img'); ?> <?php the_field('metaslider-id'); ?> <?php the_title(); ?> <?php endwhile; ?> <?php wp_reset_query(); ?> <?php endif; ?>=> Result : Only the title of per post in the term is showed
Can anyone help me to resolve this problem ???
Comment my thread or add my skype (redacted)
Thanks so much !
The topic ‘How to get data from ACF ???’ is closed to new replies.