Need help with multiple Post Types on a page.
-
hello, first sorry for my bad english.
I’m trying to make a page get all posts from select custom post types, like ‘movies’, ‘books’, ‘others’
I really don’t know how to do it, totally noob at php :/
here’s my custom page template:<?php /** * Template Name: Home Page */ get_header(); ?> <section id="content" class="clearfix"> <?php $args = array( 'post_type' => array( 'movie', 'book', 'other' ) ); $query = new WP_Query( $args ); ?> <?php while(have_posts()) : the_post(); ?> <div id="content" class="site-content" role="main"> <div class="item-list"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark"> <?php the_post_thumbnail('models-thumb'); ?></a> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a> </div> </div><!-- #content --> <?php endwhile; ?> </section> <!-- #content --> <?php get_sidebar(); ?> <?php get_footer(); ?>
i dont know what should i do, thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Need help with multiple Post Types on a page.’ is closed to new replies.