Linking to Images with PHP
-
Hello, all,
I’m having trouble linking to images in my media library with PHP. On my homepage there is a slider (Flexslider) that should show three different images next to text. Here’s my HTML and PHP:
<div class="grid-8 center flexslider white-bg boxhgt-med"> <ul class="slides"> <?php $args = array( 'post_type' => 'featured', 'orderby'=> 'rand',); $the_query = new WP_Query( $args ); $slideshow_query = new WP_Query( $args );?> <?php if ( have_posts() ) : while ( $slideshow_query->have_posts() ) : $slideshow_query->the_post(); ?> <li> <div class="grid-4"> <?php echo the_content(); ?> <h6 class="button"><a href="<?php echo the_field( 'featured_url' ); ?>">Learn More</a></h6> </div> <div class="grid-4 omega"> <img src="<?php the_field( 'event_image' ); ?>"> </div> </li> <?php endwhile; else: ?> <p><?php _e('Sorry, no pages here.'); ?></p> <?php endif; ?> </ul> </div>
All the PHP works except the images. Here’s a link to one of the images that’s supposed to show up.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Linking to Images with PHP’ is closed to new replies.