Home › Forums › Front-end Issues › the_field working only one time › Reply To: the_field working only one time
<?php get_header(); ?>
<main id="swup">
<div class="container">
<img id="logo" src="<?php the_field('logo'); ?>" alt="Logo">
</div>
<!-- Catégrories 1 -->
<div class="container categories-container">
<div class="row">
<div class="col-sm-6">
<h1 class="landing-animation categorie-title">
<?php the_field('categories_1');?>
</h1>
</div>
<div class="col-sm-6">
<?php
$args = array(
'post_type' => 'categories_1',
'posts_per_page' => 15 );
$loop = new WP_Query( $args );
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="col sub-categories-container">
<a class="title-url" href="<?php the_field('url')?>"><h1 class="landing-animation sub-categories-title"><?php the_field('title'); ?></h1></a>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
<!-- Catégories 2 -->
<div class="container categories-container">
<div class="row">
<div class="col-sm-6">
<h1 class="landing-animation categorie-title">
<?php the_field('categories_2');?>
</h1>
</div>
<div class="col-sm-6">
<?php
$args = array(
'post_type' => 'categories_2',
'posts_per_page' => 15 );
$loop = new WP_Query( $args );
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="col sub-categories-container">
<a class="title-url" href="<?php the_field('url')?>"><h1 class="landing-animation sub-categories-title"><?php the_field('title'); ?></h1></a>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
<!-- Catégories 3 -->
<div class="container categories-container">
<div class="row">
<div class="col-sm-6">
<h1 class="landing-animation categorie-title">
<?php the_field('categories_3')?>
</h1>
</div>
<div class="col-sm-6">
<?php
$args = array(
'post_type' => 'categories_3',
'posts_per_page' => 15 );
$loop = new WP_Query( $args );
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="col sub-categories-container">
<a class="title-url" href="<?php the_field('url')?>"><h1 class="landing-animation sub-categories-title"><?php the_field('title'); ?></h1></a>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
<!-- Catégories 4 -->
<div class="container categories-container">
<div class="row">
<div class="col-sm-6">
<h1 class="landing-animation categorie-title">
<?php the_field('categories_4')?>
</h1>
</div>
<div class="col-sm-6">
<?php
$args = array(
'post_type' => 'categories_4',
'posts_per_page' => 20 );
$loop = new WP_Query( $args );
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="col sub-categories-container">
<a class="title-url" href="<?php the_field('url')?>"><h1 class="landing-animation sub-categories-title"><?php the_field('title'); ?></h1></a>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
<?php get_footer(); ?>
</main>
<div class="transition-swipe overlay"></div>
</body>
</html>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.