WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Problem with images (4 posts)

  1. ElSebas
    Member
    Posted 3 years ago #

    Here is the thing, I've created 2 new custom fields for my images one for a featured post and the other for the normal posts so in my homepage the featured images are 675X400 and the normal are 300X200, the problem is when I call the archives by month obviously wordpress call the archives template:

    <div id="view_cat">
     <h1><a  href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
     <div class="feat_izq">
      <img src="<?php echo get_post_meta($post->ID, 'thumbnail', true)  ?>" alt="Post Image" class="img_catfeat" />
     </div><!--Finish feat_izq-->
     <div class="feat_der">
      <?php the_content(''); ?>
      <p><a href="<?php the_permalink() ?>" rel="leer">Leer mas</a></p>
     </div><!--Termina feat_der-->
    </div><!--Se cierra view_cat-->

    The problem is in the image im calling the one that has the ID thumbnail, and only shows that image, but I want to call both images the thumbnail and the featured one. So any ideas??

  2. Purab Kharat
    Member
    Posted 3 years ago #

    Use the following code.

    get_the_post_thumbnail($id, 'thumbnail');     // Thumbnail
    get_the_post_thumbnail($id, 'medium');        // Medium resolution
    get_the_post_thumbnail($id, 'large');         // Large resolution
    
    get_the_post_thumbnail($id, array(100,100) ); // Other resolutions
  3. ElSebas
    Member
    Posted 3 years ago #

    Ok I dont get it sorry :(, where do I put that,

    <img src="<?php echo get_post_meta($post->ID, 'thumbnail', true)  ?>" alt="Post Image" class="img_catfeat" />

    I do what?

    <img src="<?php echo get_post_meta($post->ID, array(Featured,thumbnail), true)  ?>" alt="Post Image" class="img_catfeat" />

    Sorry could you be more specific

  4. ElSebas
    Member
    Posted 3 years ago #

    Problem solved thanks!!

Topic Closed

This topic has been closed to new replies.

About this Topic