Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1168492
    Errrwin
    Participant

    Hi!

    I’m using X for my photoblog and when checking some stuff I found out that the theme uses the original image as featured image. As I use a retina plugin, it resizes a 1.968px wide image to an image of 984px wide.

    Is there any way to let the theme use the resized 984px wide image as featured image as there is one of 984px wide in the library anyway?

    #1168943
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! You can override the image size using a custom function code in your child theme’s functions.php file.

    function x_featured_image( $cropped = '' ) {
    
      $stack     = x_get_stack();
      $fullwidth = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false;
    
      if ( has_post_thumbnail() ) {
    
        if ( $cropped == 'cropped' ) {
          if ( $fullwidth ) {
            $thumb = get_the_post_thumbnail( NULL, 'entry-cropped-fullwidth', NULL );
          } else {
            $thumb = get_the_post_thumbnail( NULL, 'entry-cropped', NULL );
          }
        } else {
          if ( $fullwidth ) {
            $thumb = get_the_post_thumbnail( NULL, 'entry-fullwidth', NULL );
          } else {
            $thumb = get_the_post_thumbnail( NULL, 'entry', NULL );
          }
        }
    
        switch ( is_singular() ) {
          case true:
            printf( '<div class="entry-thumb">%s</div>', $thumb );
            break;
          case false:
            printf( '<a href="%1$s" class="entry-thumb" title="%2$s">%3$s</a>',
              esc_url( get_permalink() ),
              esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ),
              $thumb
            );
            break;
        }
    
      }
    
    }

    You can try to replace entry-fullwidth or entry with medium, large or full.

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1168492 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>