M
MASSEY
- Original Poster
- #1
Messing with custom posts and want to get a page to display some posts from that topic
The article regarding doing it for this theme, divi says
You will need to modify the loop by adding the following code:
<?php
$query = new WP_Query( array('post_type' => 'movie-reviews', 'posts_per_page' => 5 ) );
while ( $query->have_posts() ) : $query->the_post(); ?>
// Your code e.g. "the_content();"
<?php endif; wp_reset_postdata(); ?>
<?php endwhile; ?>
The code relating to this on the page already is
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
I remove it and paste the code it says but doesn't work.

The article regarding doing it for this theme, divi says
You will need to modify the loop by adding the following code:
<?php
$query = new WP_Query( array('post_type' => 'movie-reviews', 'posts_per_page' => 5 ) );
while ( $query->have_posts() ) : $query->the_post(); ?>
// Your code e.g. "the_content();"
<?php endif; wp_reset_postdata(); ?>
<?php endwhile; ?>
The code relating to this on the page already is
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
I remove it and paste the code it says but doesn't work.