• Resolved fourthelement

    (@fourthelement)


    Can you add the images as a background image.

    using this I can add the WordPress featured image as a background image:

    <section>

    <?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘full’ );?>
    <div class=”full-width”>

    <div class=”header-image parallax-background-image” data-stellar-ratio=”0.85″ style=”background-image: url(‘<?php echo $thumb[‘0′];?>’)”>
    <div class=”wrapper”>
    <div class=”s2 c8 header-image-text wow fadeInLeftBig”><h1><?php the_title() ?></h1></div>
    </div>
    </div>

    </div>

    </section>

    How would you manipulate the variables to suit your plugin for the extra featured image added so it can be displayed as a background image.

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try this:

    <?php

    $thumb = kdmfi_get_featured_image_src( ‘your-featured-image-id’, ‘full’, $post->ID ); ?>

    then

    <div class=”header-image parallax-background-image” data-stellar-ratio=”0.85″ style=”background-image: url(‘<?php echo $thumb;?>’)”>
    <div class=”wrapper”>

    Thread Starter fourthelement

    (@fourthelement)

    Perfect

    many thanks

    Plugin Author Marcus Kober

    (@marcuskober)

    @nazzilla,

    thanks for your help here! 🙂

    Cheers,
    Marcus

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘add as a background image’ is closed to new replies.