Support » Plugin: WP SmartCrop » How to use SmartCrop with div backgrounds?

  • Resolved darkNiGHTS


    I want to know the best approach to using SmartCrop with div backgrounds. Right now it’s not applying the SmartCrops, and I don’t see a documented way to do what I want. PHP code excerpt for relevant section below.

    <div class="lead" style="background: url('<?php echo $backgroundImg[0]; ?>');"> 
    			<h1 class="entry-title single-title" itemprop="headline"><?php the_title(); ?></h1>


    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author


    Hi, thanks for posting. Unfortunately SmartCrop does not support image backgrounds at this time. This has come up before, and that topic might provide some more context:

    Our recommendation would be to use a traditional <img> tag and CSS (z-index, position) to get it to behave similarly to a CSS background.

    • This reply was modified 3 years, 3 months ago by Reason: formatting
    Thread Starter darkNiGHTS


    I see, sorry I didn’t find that thread. Thanks for the response, what you suggested worked well.



    It would be nice if this was explicitly stated on the plugin homepage and website… saving trouble of install, trial-and-error, forum search, etc =(.

    Nice plugin for regular image use, though!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to use SmartCrop with div backgrounds?’ is closed to new replies.