Like the title says, I’m trying to post a custom post type to a custom page template called page-portfolio.php.

My query loop for the post does not show up on any page I put it in. I’m using the plugins Advanced Custom Fields and CPT UI.

I’ve already tried:

  1. Changing the permalink structure in settings, saving, and then changing them back
  2. Double checking that my plugin, Advanced Custom Fields, is posting if the “post-type” is “entry” (which is the post type slug I’ve created)

    <?php get_header(); ?>
    
    
    
    <section class="row">
    <div class="small-12 columns text-center">
    <div class="leader">
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <h1><?php the_title(); ?></h1> 
    <?php the_content(); ?>
    
    <?php endwhile; endif ; ?>
    
    
    </div>
    </div>
    </section>
    
    
    <?php 
    $args = array( 'post_type' => 'entry', 'posts_per_page' => 10 );
    $the_query = new WP_Query( $args ); 
    ?>
    
    <section class="row no-max pad">
    
    <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    <div class="small-6 medium-4 large-3 columns grid-item">
    <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('large'); ?></a>
    </div>
    <?php  ?>
    <?php endwhile; endif; wp_reset_postdata(); ?>
    
    </section>
    
    <?php get_footer(); ?>
    

Read more here: Created a loop for custom CPT UI post but the new post type is not showing on the custom page


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: