How Can I get Books Cover Images on front-page.php ?
-
Hello (again) NoseGraze,
I’m inserting a query of books in my front-page.php but I don’t figure out how can I get the book cover. The classic <?php the_post_thumbnail(); ?> isn’t working. I also tried with <?php get_cover_image (); ?> but it doesn’t work either. I read documentation but I cannot figure out what can I use instead of this.
This is the entire query :
/*************** LIST OF 3 LAST PUBLICATIONS USING NOVELIST *************/ $books_query = new WP_Query( array( 'post_type' => 'book', 'posts_per_page' => 3 ) ); ?> <div id="frontpage-publications"> <?php while ( $books_query->have_posts() ) : $books_query->the_post(); ?> <div id="publication-item"> <header> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> </header> <div id="publication-img"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> get_cover_image (); </a> </div> </div> <?php endwhile; ?> </div>
Best Regards,
Guillermo
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How Can I get Books Cover Images on front-page.php ?’ is closed to new replies.