• riqb44

    (@riqb44)


    Hi, I haven’t been able to crack/hack the code of my theme’s archive.php and single.php files (yet)

    Not familiar with php syntax but I found this post which together with your documentation got me to this point:

    <div class="page-content">
    		<?php
    		while ( have_posts() ) {
    
    if( class_exists('Dynamic_Featured_Image') ) {
        global $dynamic_featured_image;
    
        $featured_images = $dynamic_featured_image->get_featured_images( );
        //print_r($featured_images);
    
        //You can now loop through the image to display them as required
        foreach($featured_images as $featured_image) {
            echo "<img />";
        }
    
     }
    			the_post();
    			$post_link = get_permalink();
    			?>
    			<article class="post">
    				<?php
    				printf( '<h2 class="%s"><a href="%s">%s</a></h2>', 'entry-title', esc_url( $post_link ), esc_html( get_the_title() ) );
    				printf( '<a href="%s">%s</a>', esc_url( $post_link ), get_the_post_thumbnail( $post, 'large' ) );
    				the_excerpt();
    				?>
    			</article>
    		<?php } ?>
    	</div>

    can you or anyone else pinpoint why the extra featured images are not showing?

    Also, do you anticipate any issues with all these featured images displaying the same image (set in its respective post as a custom field) on hover, in archive pages?

    Cheers

    • This topic was modified 3 years ago by riqb44.

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

  • The topic ‘Hello Elementor archive.php’ is closed to new replies.