This tutorial goes over how to use the featured image in our single downloads page template. This will allow you to upload an image when you are creating a new digital download and display it on the front-end of your site. When selling WordPress themes it is important for users to be able to see what they are purchasing of course…
Notes from the Video
- Make sure your theme supports features images. If they are not currently enabled, you can add the following code to your
functions.php
file:123456/** Enable support for Post Thumbnails on posts and pages.** @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails*/add_theme_support( 'post-thumbnails' ); - Add the markup to display the featured image to the
content-download.php
file. It should now look like the following:1234567891011121314151617181920212223242526272829303132<?php/*** @package bootstrapwp*/?><article id="post-<?php the_ID(); ?>" <?php post_class(); ?>><header class="entry-header"><?php the_title( '<h1 class="entry-title">', '</h1>' ); ?></header><!-- .entry-header --><?php // check if the post has a Post Thumbnail assigned to it.if ( has_post_thumbnail() ) {the_post_thumbnail('full', array('class' => 'img-responsive'));} ?><div class="entry-content"><?php the_content(); ?><?phpwp_link_pages( array('before' => '<div class="page-links">' . __( 'Pages:', 'bootstrapwp' ),'after' => '</div>',) );?></div><!-- .entry-content --><footer class="entry-footer"><?php edit_post_link( __( 'Edit', 'bootstrapwp' ), '<span class="edit-link btn btn-danger btn-xs">', '</span>' ); ?></footer><!-- .entry-footer --></article><!-- #post-## --> - You can now display the featured image on your single download page!