Skip Navigation

[Resolved] View is displaying two versions of the featured image

This thread is resolved. Here is a description of the problem and solution.

Problem: View is displaying two versions of the featured image, one is cropped and one is not cropped.

Solution: I have removed id="[wpv-post-field name='_mpp_cover_id']" from View loop and placed in Content template. Screenshot here: https://toolset.com/wp-content/uploads/2017/10/575477-CT.png?x62720

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 3 replies, has 2 voices.

Last updated by Clay 3 years, 9 months ago.

Assigned support staff: Noman.

Author
Posts
#575254
firebug.jpg
custom-featured-image.jpg
basic-featured-image.jpg

I am trying to: display a featured image, with custom sizing and cropping

Link to a page where the issue can be seen: hidden link

I expected to see: my custom-size, cropped featured image

Instead, I got: the default featured image thumbnail, and below that my custom thumbnail.
Here's my loop:

<ul class="wpv-loop js-wpv-loop pyo-gallery-item">
    <wpv-loop>
        <li>
            <p class="pyo-gallery-thumbnail">[wpv-post-body view_template="mpp-gallery-thumbnail" id="[wpv-post-field name='_mpp_cover_id']"]</p>
            <p class="pyo-gallery-title">[wpv-post-link]</p>
            <p class="pyo-gallery-author">[wpv-post-author]</p>
        </li>
    </wpv-loop>
</ul>

This view is essentially creating a custom gallery view of Mediapress galleries (so that I can filter by gallery category, something that's not included in Mediapress). I'm using a content template ("mpp-gallery-thumbnail") to load the thumbnail of the gallery's cover image, specified by the post ID, which is contained in the Mediapress custom field "_mpp_cover_id."
If the body of the content template just contains a basic featured image shortcode ([wpv-post-featured-image]), then I get the result in the first screenshot. If I instead use [wpv-post-featured-image size='custom' width='320' height='320' crop='true' crop_horizontal='center' crop_vertical='top'] I get the second screenshot—the default thumbnail, and below that, the custom thumbnail. I only want the custom one. The last screenshot is what Firebug displays for the first item in the loop when I use the custom image shortcode.

#575372

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Clay,

Thank you for contacting Toolset support. As I can see this custom field "_mpp_cover_id” is from a 3rd party plugin and when you use it in the View loop along with Views shortcode:

[wpv-post-featured-image size='custom' width='320' height='320' crop='true' crop_horizontal='center' crop_vertical='top']

- It shows the images twice. Can you please tell why it is necessary to use custom field "_mpp_cover_id” ? Because the featured image returns without this.

Please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and check the issue.

Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

✙ Please provide View’s Edit link, Page / post link, and custom field link from where this is generated _mpp_cover_id.

Thank you

#575477

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

CT.png

Hello Clay,

I have removed this id="[wpv-post-field name='_mpp_cover_id']" from View loop and placed in Content template (see attached screenshot), now featured images are displaying only once with defined cropped size.

Please check here:
hidden link

Thank you

#575519

Thanks Noman, that seems to have fixed it. I appreciate the help!