Note that there are some explanatory texts on larger screens.

plurals
  1. POAllow each blog post to have different featured images
    text
    copied!<p>I am using the <code>Set featured Image</code> in WordPress to display a image at the top of each blog post. The code I am using is simple but does the job</p> <pre><code>&lt;?php get_header(); ?&gt; &lt;?php if (have_posts()): while (have_posts()) : the_post(); ?&gt; &lt;div class="featured-image"&gt; &lt;div class="featured-image-wrap"&gt; &lt;!-- Post Thumbnail --&gt; &lt;?php if ( has_post_thumbnail()) : // Check if Thumbnail exists ?&gt; &lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt; &lt;?php the_post_thumbnail(); // Fullsize image for the single post ?&gt; &lt;/a&gt; &lt;?php endif; ?&gt; &lt;!-- /Post Thumbnail --&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- Section --&gt; &lt;section class="blog"&gt; &lt;!-- Article --&gt; &lt;article class="blog-post" id="post-&lt;?php the_ID(); ?&gt;" &lt;?php post_class(); ?&gt;&gt; &lt;!-- Post Title --&gt; &lt;h1&gt; &lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; &lt;/h1&gt; &lt;!-- /Post Title --&gt; &lt;!-- Post Details --&gt; &lt;span class="date"&gt;&lt;h2&gt;Written By &lt;?php the_author(); ?&gt; on &lt;?php the_time('F j, Y'); ?&gt;&lt;/h2&gt;&lt;/span&gt; &lt;!-- /Post Details --&gt; &lt;?php the_content(); // Dynamic Content ?&gt; &lt;br class="clear"&gt; &lt;?php the_tags( __( 'Tags: ', 'html5blank' ), ', ', '&lt;br&gt;'); // Separated by commas with a line break at the end ?&gt; &lt;p&gt;&lt;?php _e( 'Categorised in: ', 'html5blank' ); the_category(', '); // Separated by commas ?&gt;&lt;/p&gt; &lt;?php edit_post_link(); // Always handy to have Edit Post Links available ?&gt; &lt;/article&gt; &lt;!-- /Article --&gt; &lt;?php endwhile; ?&gt; &lt;?php else: ?&gt; &lt;!-- Article --&gt; &lt;article&gt; &lt;h1&gt;&lt;?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?&gt;&lt;/h1&gt; &lt;/article&gt; &lt;!-- /Article --&gt; &lt;?php endif; ?&gt; &lt;/section&gt; &lt;!-- /Section --&gt; &lt;div class="finished"&gt; &lt;h2&gt;Finished! Any Questions?&lt;/h2&gt; &lt;p&gt;If you have any questions please feel free to email me or &lt;a href="http://twitter.com/joshua_hornby"&gt;Tweet me&lt;/a&gt;. If you learnt anything in this lesson or found it useful please share with your friends.&lt;/p&gt; &lt;a href="https://twitter.com/share" class="twitter-share-button" data-via="joshua_hornby" data-size="large"&gt;Tweet&lt;/a&gt; &lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");&lt;/script&gt; &lt;/div&gt; &lt;div class="blog-footer"&gt; &lt;aside class="footer-content"&gt; &lt;div class="dark-btn-footer-twitter"&gt;&lt;a href="http://twitter.com/joshua_hornby" target="_blank"&gt;@joshua_hornby&lt;/a&gt;&lt;/div&gt; &lt;div class="dark-btn-footer-twitter bottom"&gt;&lt;a href="http://designer-school.com"&gt;More Posts&lt;/a&gt;&lt;/div&gt; &lt;/aside&gt; &lt;/div&gt; </code></pre> <p>Alhough when ever I change the image when editing a post it changes it on all posts. Is there a way to allow each post to have its own feature image? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload