• Resolved guthriecenter

    (@guthrie-center)


    Hi Ankit, I have been trying to get the DFI plugin to work on our development website with no luck. I contacted the author of the theme and he said I need to change the intro-full.php file to make it work.

    The contents of that file are included below. Can you please give me an idea of what to change so I can get outstanding plugin working?

    The site is here: http://guthriecentersite-dev.springbranchisd.com/
    Thanks for the help.
    Joe

    <?php
    /**
    * The template part for displaying a full width intro.
    *
    * @package clearnews
    */

    global $post;
    $post = get_post( get_theme_mod( ‘intro_page’ ) );
    setup_postdata( $post );

    $style = ”;
    if ( has_post_thumbnail() ) {
    $thumbnail_url = wp_get_attachment_url( get_post_thumbnail_id() );
    $style = ‘ style=”background-image: url(\” . esc_url( $thumbnail_url ) . ‘\’)”‘;
    }
    ?>

    <section id=”intro” class=”marquee”<?php echo $style; ?>>

    <div class=”container”>
    <div class=”marquee-body”>
    <header class=”entry-header”>
    <?php the_title( ‘<h1 class=”entry-title”>’, ‘</h1>’ ); ?>
    </header><!– .entry-header –>

    <div class=”entry-content”>
    <?php the_content(); ?>
    <?php edit_post_link( __( ‘Edit’, ‘clearnews’ ), ‘<p>’, ‘</p>’ ); ?>
    </div>
    </div>
    </div>

    </section>

    <?php wp_reset_postdata(); ?>

    https://wordpress.org/plugins/dynamic-featured-image/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter guthriecenter

    (@guthrie-center)

    Anyone have an idea on how to get this plugin to work? Nothing happens even though photos are linked to each featured image. Thanks

    Plugin Author Ankit Pokhrel

    (@ankitpokhrel)

    Hello @guthrie-center,

    Looks like you need to add the plugin code at this place

    if ( has_post_thumbnail() ) {
        $thumbnail_url = wp_get_attachment_url( get_post_thumbnail_id() );
        $style = ' style="background-image: url(\'' . esc_url( $thumbnail_url ) . '\')"';
    }

    You can use the plugin code like this:

    if( class_exists('Dynamic_Featured_Image') ) {
         global $dynamic_featured_image;
         //to get all featured image including the WordPress one
         $featured_images = $dynamic_featured_image->get_all_featured_images( $post->ID );
    
        //You can now loop through the image to display them as required
     }

    Regards,
    Ankit

    Hey Ankit,
    I’m having a similar problem, I’m not sure where to put this code to make it work?

    I’m using gridstack as the theme, and and I’m using portfolio pages, this is where I want to add multiple feature images to each page and then have them post to the home page. The plugin seems to work, but they aren’t posting to the homepage.

    I tried putting the code above on the index page and a couple other places and it doesn’t seem to be working… I’m not sure what I’m doing wrong and I’m still a little new to wordpress.

    Here is my website.
    http://www.outre-graphics.com/outre

    Any help would be great! Thanks, julie

    Where do we put this code? functions php? header?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Where to add code to make it work’ is closed to new replies.