• Resolved psntr

    (@psntr)


    Is it possible to provide a PHP example on how you get your image on the frontend?
    I’m using a custom post type and tried your plugin for its featured image.

    While I use the default worpdpress function to call my image for the frontend, the data-crop doesn’t show on the frontend…

    Are you also using:
    if ( has_post_thumbnail() ) { the_post_thumbnail(); }

    • This topic was modified 5 years, 12 months ago by psntr.
Viewing 1 replies (of 1 total)
  • Plugin Contributor gschoppe

    (@gschoppe)

    Hi psntr,

    The reason you aren’t seeing the smartcrop data attributes is that the_post_thumbnail() defaults to using the ‘post-thumbnail’ image size, which is a cropped image size, and therefore cannot be properly smartcropped. To enable smartcropping, just set the image size to any non-cropped image size, such as the_post_thumbnail('full').

Viewing 1 replies (of 1 total)
  • The topic ‘Provide a PHP use case’ is closed to new replies.