So here's my question:
I need to build a custom post type to add employees to a website. The problem is, it need to be shown:
1 - Image on the Right 2 - Image on the Left ... and so on.
For this I made a page template where I need this custom post type content to be shown. To style the custom post type differently I made two different post type templates and I created two posts with those templates.
Now my problem is: How can I show this custom post types with his templates inside my custom page template?
I tried with this code:
<?php
$args = array( 'post_type' => 'equipa', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_post();
endwhile;
?>
But it's throwing me these errors:
Notice: Undefined offset: 1 in C:\xampp\htdocs\WP\wp-includes\class-wp-query.php on line 3071
Notice: Undefined offset: 2 in C:\xampp\htdocs\WP\wp-includes\class-wp-query.php on line 3071
Anyone have any idea on what i'm doing wrong here?