Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1200478
    Magik Web
    Participant

    Can the Portfolio use a specific image for the thumbnail and a different one for the content page?

    In exemple, we’re trying to have the Portfolio list client logos and each item have a preview of their website.
    Logo: 268×28
    Website preview: 1170xVAR

    The only idea we’ve had so far is to customize the template file by hardcoding a PHP switch that goes: If this client, this image (times the amount of clients).

    Is there a more a refined way?

    https://magikweb.ca/clients
    Thank you!

    #1200530
    Rahul
    Moderator

    Hey There,

    Thanks for writing in!

    Yes, it is actually possible to use a different images for the thumbnail and content page. Kindly walk-through this thread and follow the given guidelines there :

    https://community.theme.co/forums/topic/override-the-portfolio-feature-image-to-be-disabled-on-page-but-show-thumbnail/

    Let us know how this goes!

    #1200923
    Magik Web
    Participant

    Thank you Rahul!
    It’s slightly difficult to follow since all the URLs are now 404 error pages.
    I understand that the featured image can be hidden with CSS, but how is it replaced by a different image?

    #1201315
    Friech
    Moderator

    Hi There,

    Sorry, I’m not sure what do you mean by this: If this client, this image (times the amount of clients).

    Anyways, you can copy the file /x/framework/views/integrity/content-portfolio.php to your child theme’s /x-child/framework/views/integrity/ directory and modified that file to achieve your needs. Regretfully, this would be outside the scope of support we can offer.

    Or you can add the larger image as content, and hide the small (featured) image with this custom CSS

    .single-x-portfolio .entry-featured {display: none;}

    Thanks.

    #1202006
    Magik Web
    Participant

    Hello Friech,
    I attached two files to visualize what we’re trying to do.

    In other words, we want to keep the Portfolio listing the same, but when you click an item, instead of showing the featured image, we show a different one at its place.

    If the attached files didn’t work like previously:
    Listing: https://magikweb.ca/download/hotlink/thumbnails.png
    Item: https://magikweb.ca/download/hotlink/item.png

    Thank you for your patience, your help is greatly appreciated!

    #1202586
    Friech
    Moderator

    Hi There,

    So putting the alternate feature image as a content is not an option? If so, please install the ACF Pro extension from the Addons panel. After a successful installation and activating the plugin, navigate to Custom Fields > Tools. Download and import this Field Groups.

    Then on your child theme, navigate to this directory \x-child\framework\views\integrity\ create a file named content-portfolio.php and paste the code below on it, then save.

    <?php
    
    // =============================================================================
    // VIEWS/INTEGRITY/CONTENT-PORTFOLIO.PHP
    // -----------------------------------------------------------------------------
    // Portfolio post output for Integrity.
    // =============================================================================
    
    $archive_share = x_get_option( 'x_integrity_portfolio_archive_post_sharing_enable' );
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
      <div class="entry-featured">
       <?php if ( is_single () ) : ?>
              <img src="<?php the_field('alternate_feature_image'); ?>" class="attachment-entry-fullwidth size-entry-fullwidth wp-post-image" />
           <?php else : ?>
              <?php x_portfolio_item_featured_content(); ?>
        <?php endif; ?>
      </div>
      <div class="entry-wrap cf">
    
        <?php if ( x_is_portfolio_item() ) : ?>
    
          <div class="entry-info">
            <header class="entry-header">
              <h1 class="entry-title entry-title-portfolio"><?php the_title(); ?></h1>
              <?php x_integrity_entry_meta(); ?>
            </header>
            <?php x_get_view( 'global', '_content', 'the-content' ); ?>
          </div>
          <div class="entry-extra">
            <?php x_portfolio_item_tags(); ?>
            <?php x_portfolio_item_project_link(); ?>
            <?php x_portfolio_item_social(); ?>
          </div>
    
        <?php else : ?>
    
          <header class="entry-header">
            <h2 class="entry-title entry-title-portfolio">
              <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php x_the_alternate_title(); ?></a>
            </h2>
            <?php if ( $archive_share == '1' ) : ?>
              <?php x_portfolio_item_social(); ?>
            <?php endif; ?>
          </header>
    
        <?php endif; ?>
    
      </div>
    </article>

    If done successfully, a new meta box above the Featured Image should show.


    screenshot

    Let us know how it goes.

    Cheers!

    #1203570
    Magik Web
    Participant

    Yes!! I apologize for being unclear. This solution is exactly what we needed, thank you very much!

    #1203628
    Thai
    Moderator

    You’re most welcome 🙂

    If you need anything else please let us know.

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