Loop cutsom post type in meta box
-
I am creating a wordpress template. I added a meta box on front-page.php. I wish that the user has the choice to show or not his achievements on the homepage. If he wants to show his achievements, he can choose which achievement he wants to display in the homepage among the achievements present in the portfolio. I specify that ‘capacity_portfolio’ is custom post type.
<?php $args = array( 'post_type' => 'capacity_portfolio'); $loop = new WP_Query( $args ); if ($loop->have_posts()) : while ( $loop->have_posts() ) : $loop->the_post(); the_title(); endwhile; endif; ?>
a strange thing happens: all the meta boxes on the page are suplicated, see figure here. help me please !
When I replace the custom post type ‘capacity_portfolio’, by the post type ‘page’, it works, but when I replace it with the post type ‘post’ it does not work. I said that when I erase this piece of code, the metabox works properly.
- The topic ‘Loop cutsom post type in meta box’ is closed to new replies.