I'm building a WordPress website. Everything went fine before using custom post types. When I use CPT and write PHP code then a section can't print the custom fields. This affects only one section. Other sections and custom fields works fine.
Before adding this code the custom field worked fine:
<?php
$args = array("post_type" => "project_feature");
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="col-sm-4">
<?php
if(has_post_thumbnail())
{
the_post_thumbnail();
}
?>
<h3><?php the_title(); ?></h3>
<div class="black_text"><?php the_content(); ?></div>
</div> <!-- col -->
<?php endwhile; wp_reset_query(); ?>
But now if I delete this code my custom feature still doesn't work. I don't understand what I am doing wrong. I still don't know if it's my code or something else in WordPress.
This custom fields within the instructor section aren't working:
<?php
// instructor custom fields
$instructor_name = get_field('instructor_name');
$instructor_description = get_field('instructor_description');
$students = get_field('students');
$views = get_field('views');
$courses = get_field('courses');
?>
<!-- INSTRUCTOR
=========================================
-->
<section id="instructor">
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="row">
<div class="col-sm-8">
<h3>Your Instructor <small><?php echo $instructor_name; ?></small></h3>
</div> <!-- col -->
<div class="col-sm-4">
<ul>
<li>
<a href="http://www.fb.com"><i class="fa fa-facebook social" aria-hidden="true"></i></a>
</li>
<li>
<a href="http://www.google.com"><i class="fa fa-google-plus social" aria-hidden="true"></i></a>
</li>
<li>
<a href="http://www.linkedin.com"><i class="fa fa-linkedin social" aria-hidden="true"></i></a>
</li>
</ul>
</div> <!-- col -->
</div> <!-- row -->
<div class="row">
<div class="col-sm-12">
<p class="black_text"><?php echo $instructor_description; ?></p>
<hr>
</div> <!-- col -->
</div> <!-- row -->
<div class="row">
<div class="col-sm-12">
<h3>The numbers <small>They don't lie...</small></h3>
</div> <!-- col -->
<div class="col-sm-4 round_display">
<p class="black_text"><?php echo $students; ?> students</p>
</div> <!-- col -->
<div class="col-sm-4 round_display">
<p class="black_text"><?php echo $views; ?> views</p>
</div> <!-- col -->
<div class="col-sm-4 round_display">
<p class="black_text"><?php echo $courses; ?> courses</p>
</div> <!-- col -->
</div> <!-- row -->
</div> <!-- col -->
<div class="col-sm-6">
<img src="<?php bloginfo('stylesheet_directory'); ?>/image/brad.png" alt="man" class="img-responsive center-block income_image"/>
</div> <!-- col -->
</div> <!-- row -->
</div> <!-- container -->
</section> <!-- INSTRUCTOR -->