Thanks for taking a look at my question.
I have created a custom post that is called "movies" I have managed to get it to show a list of movies and I have created a single page called "single-movies.php"
I'm also using a plugin called Advanced Custom Fields to add fields, the problem is when I click on a movie to get more details, it shows all the movies details when I only want the one I clicked on.
So for example if I have 4 movies added it with the custom post, it will show all 4 movie details in the single-movies page, example:
mydomain.com/movies/avangers-2
The above url is suppose to only show me details from the avengers 2 but it shows me every single custom post I have added.
Here's the code for single-movies.php
<?php
$args = array(
'post_type' => 'movies',
'post_status' => 'publish');
$loop = new WP_Query( $args );
if( $loop->have_posts() ):
while( $loop->have_posts() ): $loop->the_post();?>
<div class="movie-details">
<h2><?php the_title(); ?></h2>
<img href="<?php the_field('movie_img_url'); ?>" />
<?php the_field('movie_synopsis', $post_id); ?>
<?php the_field('movie_analysis', $post_id); ?>
</div>
<?php
endwhile;
endif;
?>
</div>
Is this a problem with the query? or maybe Advanced Custom Fields is not able to display single records.
I really hope this question makes sense. I look forward to hearing from you, thank you in advance.