Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Consider using the defaul post thumbnails functions instead of naming the image after the post.</p> <p>Add this to your functions.php</p> <pre><code>add_theme_support( 'post-thumbnails' ); </code></pre> <p>Then on the editor you'll be able to select which image is the default "featured" image. To display the images on the loop you'll use either <a href="http://codex.wordpress.org/Function_Reference/the_post_thumbnail" rel="nofollow">the_post_thumbnail()</a> or <a href="http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail" rel="nofollow">get_the_post_thumbnail()</a> like this:</p> <pre><code>&lt;p class="the-picture"&gt;&lt;?php the_post_thumbnail(); ?&gt;&lt;/p&gt; </code></pre> <p><strong>EDIT:</strong></p> <p>if you can't use the default thumbs functionalilty, maybe you can create another post field with <a href="http://codex.wordpress.org/Function_Reference/add_meta_box" rel="nofollow">add_meta_box();</a> and include it in every post save with <a href="http://codex.wordpress.org/Function_Reference/update_post_meta" rel="nofollow">update_post_meta();</a>. </p> <p>This way you'll have a permanent value on your DB to tell you which thumb to use on the cat list, and you'll be able to retrieve it with <a href="http://codex.wordpress.org/Function_Reference/get_post_meta" rel="nofollow">get_post_meta()</a> on category.php like this:</p> <pre><code>&lt;p class="the-picture"&gt;&lt;?php echo get_post_meta($post-&gt;ID, $cat_picture, true); ?&gt;&lt;/p&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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