Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1000877
    PanInternational
    Participant

    Hi,
    I didn’t found a solution for using a different image on the portfolio thumbnail.
    But I notice that when we use the Edit image inside wordpress Media, we can crop the image and select the option on the Apply changes to: All sizes except thumbnail. Which means that we can crop an image that will be displayed differently from the thumbnail.
    The thing is, I cut the image but is displayed (inside portfolio item) anymore, gives an error, while the thumbnail displays correctly.

    Can you help?

    Thank you

    #1000916
    Rupok
    Member

    Hi there,

    Would you clarify which error you are facing? And also provide the exact URL of the page in question.

    Thanks

    #1001120
    PanInternational
    Participant
    This reply has been marked as private.
    #1001166
    Rue Nel
    Moderator

    Hello There,

    The featured image dimension is taken up from the default image size being calculated from your settings in the customizer, Appearance > Customize > layout & Design > Content Layout. This is dynamically computed based on your settings. To resolve your issue for you to be able to control the thumbnails, since you already have your child theme active and ready, please insert this following 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 );
          }
        }
    
        if ( ! is_single() ) {
    
          // you can use 'thumbnail', 'medium', 'large' or 'full'
          $thumb = get_the_post_thumbnail( NULL, 'thumbnail', 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;
        }
    
      }
    
    }

    Feel free to change whatever applies to you for easier editing of the thumbnails. Simply find this lines:

    
    // you can use 'thumbnail', 'medium', 'large' or 'full'
    $thumb = get_the_post_thumbnail( NULL, 'thumbnail', NULL );

    In the code, the default will display the thumbnail which is mostly 150×150 pixels. If you want something bigger, you can change it to medium or large.

    Hope this helps.

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