Reputation: 1
How can I display only the thumbnail and title of a post in WordPress like here: http://themes.premiumpixels.com/?theme=artiste
P.S. I'm not advertising anything, I just posted a question because I have no idea how to do something like that.
Upvotes: 0
Views: 6768
Reputation: 10571
You need to do this for the image:
http://www.wpbeginner.com/wp-themes/how-to-add-post-thumbnails-in-wordpress/
And you need to do this for the little text:
Add this in function.php:
add_post_type_support( 'page', 'excerpt' );
then add this below your post_thumbnail in your template as the link demonstrate you:
<?php the_exceprt(); ?>
Upvotes: 0
Reputation: 342
// From your loop just remove the_content() or the_excerpt() call
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<!-- do stuff ... -->
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
}
post_title();// to display the post title
<?php endwhile; ?>
<?php endif; ?>
Upvotes: 2