Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #1326960
Featured Images
Closed

Comments

  • jennamabile started the conversation

    I am trying to change the overall featured image size to a standard, site-wide size on single posts. I don't want to have to manually adjust my images, but rather upload whatever mixed sizes they are and have the template automatically adjust them - maintaining aspect ratio. They are currently mixed sizes and it looks odd, but more importantly, when you view a single post, some are huge and it looks awful.

    Thanks in advance! Love this theme!

  •  2,701
    PenciDesign replied

    Hi,

    Do you mean that you want to change the image size on single post page to a fixed size?

    If right, you need to modify the code in this theme. Please replace this code to:

    <?php
    if ( ! get_theme_mod( 'penci_disable_lightbox_single' ) ) {
    $thumb_url = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
    ?>
    <a class="penci-image-holder penci-lazy" data-rel="penci-gallery-image-content" data-src="<?php echo penci_get_featured_image_size( get_the_ID(), 'penci-full-thumb' ); ?>" href="<?php echo esc_url( $thumb_url ); ?>"></a>
    <?php
    }
    else {
    ?>
    <div class="penci-image-holder penci-lazy" data-src="<?php echo penci_get_featured_image_size( get_the_ID(), 'penci-full-thumb' ); ?>"></div>
    <?php
    }

    Best Regards,

    PenciDesign

  • jennamabile replied

    Hi, thank you for the reply. That is not what I wanted. That kept the featured image huge as it was already and then made my content overlay the image which made the post illegible. I am simply trying to set a size for my featured images so that they are all the same size on posts.

  • jennamabile replied

    When I have images that I set as featured images on posts, they are not the same size for every post.  I would like to set a featured image and have it show on the post as the same size for every post regardless of the actual image dimensions. So, in essence, I want the code to size my images for me.

  •  2,701
    PenciDesign replied

    Hi,

    If so, please try replace the code I said in my previous email to this code:

    <?php
    if ( ! get_theme_mod( 'penci_disable_lightbox_single' ) ) {
    $thumb_url = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
    echo '<a href="' . esc_url( $thumb_url ) . '" data-rel="penci-gallery-image-content">';
    ?>
    <?php if( ! get_theme_mod( 'penci_disable_lazyload_single' ) ) { ?>
    <img class="attachment-penci-magazine-slider size-penci-magazine-slider penci-lazy wp-post-image" src="<?php echo get_template_directory_uri() . '/images/penci2-holder.png'; ?>" alt="<?php wp_strip_all_tags( the_title() ); ?>" data-src="<?php echo penci_get_featured_image_size( get_the_ID(), 'penci-magazine-slider' ); ?>">
    <?php } else { ?>
    <?php the_post_thumbnail( 'penci-magazine-slider' ); ?>
    <?php }?>
    <?php
    echo '</a>';
    }
    else {
    ?>
    <?php if( ! get_theme_mod( 'penci_disable_lazyload_single' ) ) { ?>
    <img class="attachment-penci-magazine-slider size-penci-magazine-slider penci-lazy wp-post-image" src="<?php echo get_template_directory_uri() . '/images/penci2-holder.png'; ?>" alt="<?php wp_strip_all_tags( the_title() ); ?>" data-src="<?php echo penci_get_featured_image_size( get_the_ID(), 'penci-magazine-slider' ); ?>">
    <?php } else { ?>
    <?php the_post_thumbnail( 'penci-magazine-slider' ); ?>
    <?php }?>
    <?php
    }

    Hope that help,

    Best Regards,

    PenciDesign